mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-08 20:47:47 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a1c188d5 | ||
|
|
6db5d8fb30 |
@@ -1,12 +1,12 @@
|
||||
lockVersion: 2.0.0
|
||||
id: dfa99515-01c0-42eb-9be5-ee212fd03eb3
|
||||
management:
|
||||
docChecksum: a643a64d282d705e3e24f61ed6f068c6
|
||||
docChecksum: 7dec92ab9151a1b5a35df5faa81811ba
|
||||
docVersion: 0.0.3
|
||||
speakeasyVersion: 1.476.2
|
||||
generationVersion: 2.495.1
|
||||
releaseVersion: 0.17.3
|
||||
configChecksum: b217b6f314764baeb1666f2a287fd80a
|
||||
speakeasyVersion: 1.487.0
|
||||
generationVersion: 2.506.0
|
||||
releaseVersion: 0.18.0
|
||||
configChecksum: 2c67410bd5eed3f54f23e32506d938ab
|
||||
repoURL: https://github.com/LukeHagar/plexgo.git
|
||||
repoSubDirectory: .
|
||||
installationURL: https://github.com/LukeHagar/plexgo
|
||||
@@ -14,8 +14,8 @@ management:
|
||||
features:
|
||||
go:
|
||||
additionalDependencies: 0.1.0
|
||||
constsAndDefaults: 0.1.6
|
||||
core: 3.6.9
|
||||
constsAndDefaults: 0.1.7
|
||||
core: 3.7.0
|
||||
defaultEnabledRetries: 0.2.0
|
||||
deprecations: 2.81.2
|
||||
downloadStreams: 0.1.2
|
||||
@@ -52,8 +52,10 @@ generatedFiles:
|
||||
- /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
|
||||
@@ -96,6 +98,7 @@ generatedFiles:
|
||||
- /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
|
||||
@@ -128,8 +131,10 @@ generatedFiles:
|
||||
- /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
|
||||
@@ -171,6 +176,7 @@ generatedFiles:
|
||||
- /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
|
||||
@@ -202,6 +208,12 @@ generatedFiles:
|
||||
- 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/applyupdatesrequest.md
|
||||
- docs/models/operations/applyupdatesresponse.md
|
||||
- docs/models/operations/autoselectsubtitle.md
|
||||
@@ -266,11 +278,21 @@ generatedFiles:
|
||||
- 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/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/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
|
||||
@@ -554,6 +576,7 @@ generatedFiles:
|
||||
- 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
|
||||
@@ -564,11 +587,17 @@ generatedFiles:
|
||||
- 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/home.md
|
||||
- docs/models/operations/hub.md
|
||||
- docs/models/operations/image.md
|
||||
- docs/models/operations/includecollections.md
|
||||
@@ -605,9 +634,11 @@ generatedFiles:
|
||||
- docs/models/operations/operator.md
|
||||
- docs/models/operations/optimizedforstreaming.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
|
||||
@@ -635,6 +666,7 @@ generatedFiles:
|
||||
- docs/models/operations/postuserssignindatauserprofile.md
|
||||
- docs/models/operations/postuserssignindatawatchedindicator.md
|
||||
- docs/models/operations/producer.md
|
||||
- docs/models/operations/protected.md
|
||||
- docs/models/operations/protocol.md
|
||||
- docs/models/operations/provider.md
|
||||
- docs/models/operations/queryparamfilter.md
|
||||
@@ -648,6 +680,7 @@ generatedFiles:
|
||||
- docs/models/operations/ratings.md
|
||||
- docs/models/operations/release.md
|
||||
- docs/models/operations/responsebody.md
|
||||
- docs/models/operations/restricted.md
|
||||
- docs/models/operations/role.md
|
||||
- docs/models/operations/scope.md
|
||||
- docs/models/operations/searchresult.md
|
||||
@@ -758,6 +791,10 @@ generatedFiles:
|
||||
- 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
|
||||
@@ -766,6 +803,10 @@ generatedFiles:
|
||||
- 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
|
||||
@@ -924,6 +965,10 @@ generatedFiles:
|
||||
- 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
|
||||
@@ -1007,6 +1052,7 @@ generatedFiles:
|
||||
- docs/sdks/sessions/README.md
|
||||
- docs/sdks/statistics/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
|
||||
@@ -1043,6 +1089,7 @@ generatedFiles:
|
||||
- types/decimal.go
|
||||
- types/pointers.go
|
||||
- updater.go
|
||||
- users.go
|
||||
- video.go
|
||||
- watchlist.go
|
||||
examples:
|
||||
@@ -2031,5 +2078,53 @@ examples:
|
||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||
"401":
|
||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
|
||||
get-genres-library:
|
||||
speakeasy-default-get-genres-library:
|
||||
parameters:
|
||||
path:
|
||||
sectionKey: 9518
|
||||
responses:
|
||||
"200":
|
||||
application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Shows (Reality)", "title2": "By Genre", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/10/all?genre=89", "key": "89", "title": "Action", "type": "genre"}]}}
|
||||
"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}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
|
||||
get-countries-library:
|
||||
speakeasy-default-get-countries-library:
|
||||
parameters:
|
||||
path:
|
||||
sectionKey: 9518
|
||||
responses:
|
||||
"200":
|
||||
application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Series", "title2": "By Country", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/2/all?country=15491", "key": "15491", "title": "Japan"}]}}
|
||||
"400":
|
||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||
"401":
|
||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
|
||||
get-users:
|
||||
"":
|
||||
parameters:
|
||||
header:
|
||||
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
|
||||
X-Plex-Product: "Plex for Roku"
|
||||
X-Plex-Device: "Roku 3"
|
||||
X-Plex-Device-Name: "Chrome"
|
||||
X-Plex-Device-Screen-Resolution: "1487x1165,2560x1440"
|
||||
X-Plex-Version: "2.4.1"
|
||||
X-Plex-Platform: "Roku"
|
||||
X-Plex-Features: "external-media,indirect-media,hub-style-list"
|
||||
X-Plex-Model: "4200X"
|
||||
X-Plex-Session-Id: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"
|
||||
X-Plex-Language: "en"
|
||||
X-Plex-Platform-Version: "4.3 build 1057"
|
||||
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
|
||||
responses:
|
||||
"200":
|
||||
application/xml: "0xa9CdebeF9E"
|
||||
"400":
|
||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||
"401":
|
||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
|
||||
examplesVersion: 1.0.0
|
||||
generatedTests: {}
|
||||
|
||||
@@ -13,7 +13,7 @@ generation:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
go:
|
||||
version: 0.17.3
|
||||
version: 0.18.0
|
||||
additionalDependencies: {}
|
||||
allowUnknownFieldsInWeakUnions: false
|
||||
clientServerStatusCodesAsErrors: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.476.2
|
||||
speakeasyVersion: 1.487.0
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -9,19 +9,19 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
|
||||
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
|
||||
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
|
||||
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1738022950
|
||||
- speakeasy-sdk-regen-1738886963
|
||||
targets:
|
||||
plexgo:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c
|
||||
sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696
|
||||
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
|
||||
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
|
||||
codeSamplesNamespace: code-samples-go-plexgo
|
||||
codeSamplesRevisionDigest: sha256:d074910cd257c690cd88b954cb7adc3401529828c1a9b0b79a96d1fe780cab97
|
||||
codeSamplesRevisionDigest: sha256:e556c9b714f159036257d9405e7e72e55f72c2ad96b306a7ccaa287d4d33829c
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
@@ -144,6 +144,8 @@ func main() {
|
||||
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
||||
* [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
|
||||
* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
|
||||
* [GetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
|
||||
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||
@@ -224,6 +226,10 @@ func main() {
|
||||
* [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
|
||||
|
||||
20
RELEASES.md
20
RELEASES.md
@@ -1013,3 +1013,23 @@ Based on:
|
||||
- [go v0.17.3] .
|
||||
### Releases
|
||||
- [Go v0.17.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.3 - .
|
||||
|
||||
## 2025-02-06 00:09:00
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.4] .
|
||||
### Releases
|
||||
- [Go v0.17.4] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.4 - .
|
||||
|
||||
## 2025-02-07 00:09:08
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.487.0 (2.506.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.18.0] .
|
||||
### Releases
|
||||
- [Go v0.18.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.18.0 - .
|
||||
@@ -128,19 +128,19 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: added
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{\n ContentDirectoryID: 470161,\n SectionID: plexgo.Int64(2),\n Type: operations.TypeTvShow,\n IncludeMeta: operations.IncludeMetaEnable.ToPointer(),\n XPlexContainerStart: plexgo.Int(0),\n XPlexContainerSize: plexgo.Int(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{\n ContentDirectoryID: 470161,\n SectionID: plexgo.Int64(2),\n Type: operations.TypeTvShow,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/hubs/search"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: performSearch
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Search.PerformSearch(ctx, \"dylan\", nil, plexgo.Float64(5))\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Search.PerformSearch(ctx, \"dylan\", nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/hubs/search/voice"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: performVoiceSearch
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Search.PerformVoiceSearch(ctx, \"dead+poop\", nil, plexgo.Float64(5))\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Search.PerformVoiceSearch(ctx, \"dead+poop\", nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -200,13 +200,13 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: library
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{\n ContentDirectoryID: plexgo.Int64(2),\n PinnedContentDirectoryID: []int64{\n 3,\n 5,\n 7,\n 13,\n 12,\n 1,\n 6,\n 14,\n 2,\n 10,\n 16,\n 17,\n },\n SectionID: plexgo.Int64(2),\n Type: operations.QueryParamTypeTvShow,\n IncludeMeta: operations.QueryParamIncludeMetaEnable.ToPointer(),\n XPlexContainerStart: plexgo.Int(0),\n XPlexContainerSize: plexgo.Int(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{\n ContentDirectoryID: plexgo.Int64(2),\n PinnedContentDirectoryID: []int64{\n 3,\n 5,\n 7,\n 13,\n 12,\n 1,\n 6,\n 14,\n 2,\n 10,\n 16,\n 17,\n },\n SectionID: plexgo.Int64(2),\n Type: operations.QueryParamTypeTvShow,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/search"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: libraries
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{\n Query: \"<value>\",\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n SearchTypes: []operations.SearchTypes{\n operations.SearchTypesPeople,\n },\n IncludeCollections: operations.QueryParamIncludeCollectionsEnable.ToPointer(),\n IncludeExternalMedia: operations.QueryParamIncludeExternalMediaEnable.ToPointer(),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{\n Query: \"<value>\",\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n SearchTypes: []operations.SearchTypes{\n operations.SearchTypesPeople,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -218,7 +218,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: list
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{\n Filter: operations.FilterAvailable,\n XPlexContainerStart: plexgo.Int(0),\n XPlexContainerSize: plexgo.Int(50),\n XPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{\n Filter: operations.FilterAvailable,\n XPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -230,7 +230,19 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: details
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer())\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections/{sectionKey}/country"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: library
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetCountriesLibrary(ctx, 9518)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: library
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetGenresLibrary(ctx, 9518)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -248,7 +260,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: items
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{\n Tag: operations.TagEdition,\n IncludeGuids: operations.IncludeGuidsEnable.ToPointer(),\n Type: operations.GetLibraryItemsQueryParamTypeTvShow.ToPointer(),\n SectionKey: 9518,\n IncludeMeta: operations.GetLibraryItemsQueryParamIncludeMetaEnable.ToPointer(),\n XPlexContainerStart: plexgo.Int(0),\n XPlexContainerSize: plexgo.Int(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{\n Tag: operations.TagEdition,\n Type: operations.GetLibraryItemsQueryParamTypeTvShow.ToPointer(),\n SectionKey: 9518,\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/log"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -290,7 +302,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: getPin
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{\n Strong: plexgo.Bool(false),\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.AuthPinContainer != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.AuthPinContainer != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/pins/{pinID}"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -356,7 +368,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: resources
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Plex.GetServerResources(ctx, \"3381b62b-9ab7-4e37-827b-203e9809eb58\", operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer())\n if err != nil {\n log.Fatal(err)\n }\n if res.PlexDevices != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Plex.GetServerResources(ctx, \"3381b62b-9ab7-4e37-827b-203e9809eb58\", nil, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.PlexDevices != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/search"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -447,12 +459,18 @@ actions:
|
||||
- lang: go
|
||||
label: getTokenDetails
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Authentication.GetTokenDetails(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.UserPlexAccount != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/users"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: users
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Users.GetUsers(ctx, operations.GetUsersRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n DeviceName: plexgo.String(\"Chrome\"),\n DeviceScreenResolution: plexgo.String(\"1487x1165,2560x1440\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n ClientFeatures: plexgo.String(\"external-media,indirect-media,hub-style-list\"),\n Model: plexgo.String(\"4200X\"),\n XPlexSessionID: plexgo.String(\"97e136ef-4ddd-4ff3-89a7-a5820c96c2ca\"),\n XPlexLanguage: plexgo.String(\"en\"),\n PlatformVersion: plexgo.String(\"4.3 build 1057\"),\n XPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Body != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/users/signin"]["post"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: data
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n RequestBody: &operations.PostUsersSignInDataRequestBody{\n Login: \"username@email.com\",\n Password: \"password123\",\n RememberMe: plexgo.Bool(false),\n VerificationCode: plexgo.String(\"123456\"),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UserPlexAccount != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n RequestBody: &operations.PostUsersSignInDataRequestBody{\n Login: \"username@email.com\",\n Password: \"password123\",\n VerificationCode: plexgo.String(\"123456\"),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UserPlexAccount != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
|
||||
11
docs/models/operations/alllibraries.md
Normal file
11
docs/models/operations/alllibraries.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllLibraries
|
||||
|
||||
Indicates if the user has access to all libraries.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------- | --------------------- |
|
||||
| `AllLibrariesDisable` | 0 |
|
||||
| `AllLibrariesEnable` | 1 |
|
||||
11
docs/models/operations/allowcameraupload.md
Normal file
11
docs/models/operations/allowcameraupload.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowCameraUpload
|
||||
|
||||
Indicates if the user is allowed to upload from a camera.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------- | -------------------------- |
|
||||
| `AllowCameraUploadDisable` | 0 |
|
||||
| `AllowCameraUploadEnable` | 1 |
|
||||
11
docs/models/operations/allowchannels.md
Normal file
11
docs/models/operations/allowchannels.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowChannels
|
||||
|
||||
Indicates if the user has access to channels.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------------- | ---------------------- |
|
||||
| `AllowChannelsDisable` | 0 |
|
||||
| `AllowChannelsEnable` | 1 |
|
||||
11
docs/models/operations/allowsubtitleadmin.md
Normal file
11
docs/models/operations/allowsubtitleadmin.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowSubtitleAdmin
|
||||
|
||||
Indicates if the user can manage subtitles.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `AllowSubtitleAdminDisable` | 0 |
|
||||
| `AllowSubtitleAdminEnable` | 1 |
|
||||
11
docs/models/operations/allowsync.md
Normal file
11
docs/models/operations/allowsync.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowSync
|
||||
|
||||
Indicates if the user is allowed to sync media.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------ | ------------------ |
|
||||
| `AllowSyncDisable` | 0 |
|
||||
| `AllowSyncEnable` | 1 |
|
||||
11
docs/models/operations/allowtuners.md
Normal file
11
docs/models/operations/allowtuners.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AllowTuners
|
||||
|
||||
Indicates if the user is allowed to use tuners.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------- | -------------------- |
|
||||
| `AllowTunersDisable` | 0 |
|
||||
| `AllowTunersEnable` | 1 |
|
||||
10
docs/models/operations/getcountrieslibrarydirectory.md
Normal file
10
docs/models/operations/getcountrieslibrarydirectory.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
22
docs/models/operations/getcountrieslibrarymediacontainer.md
Normal file
22
docs/models/operations/getcountrieslibrarymediacontainer.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetCountriesLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *float64* | :heavy_check_mark: | N/A | 50 |
|
||||
| `Offset` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `TotalSize` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg |
|
||||
| `Content` | *string* | :heavy_check_mark: | N/A | secondary |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | N/A | 1734362201 |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | N/A | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/show.png |
|
||||
| `Title1` | *string* | :heavy_check_mark: | N/A | TV Series |
|
||||
| `Title2` | *string* | :heavy_check_mark: | N/A | By Country |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | N/A | secondary |
|
||||
| `Directory` | [][operations.GetCountriesLibraryDirectory](../../models/operations/getcountrieslibrarydirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
8
docs/models/operations/getcountrieslibraryrequest.md
Normal file
8
docs/models/operations/getcountrieslibraryrequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetCountriesLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
11
docs/models/operations/getcountrieslibraryresponse.md
Normal file
11
docs/models/operations/getcountrieslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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. |
|
||||
10
docs/models/operations/getcountrieslibraryresponsebody.md
Normal file
10
docs/models/operations/getcountrieslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetCountriesLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetCountriesLibraryMediaContainer](../../models/operations/getcountrieslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
11
docs/models/operations/getgenreslibrarydirectory.md
Normal file
11
docs/models/operations/getgenreslibrarydirectory.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
22
docs/models/operations/getgenreslibrarymediacontainer.md
Normal file
22
docs/models/operations/getgenreslibrarymediacontainer.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GetGenresLibraryMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `Size` | *float64* | :heavy_check_mark: | N/A | 50 |
|
||||
| `Offset` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `TotalSize` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
|
||||
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
|
||||
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg |
|
||||
| `Content` | *string* | :heavy_check_mark: | N/A | secondary |
|
||||
| `MediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
|
||||
| `MediaTagVersion` | *int64* | :heavy_check_mark: | N/A | 1734362201 |
|
||||
| `Nocache` | *bool* | :heavy_check_mark: | N/A | true |
|
||||
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/show.png |
|
||||
| `Title1` | *string* | :heavy_check_mark: | N/A | TV Shows (Reality) |
|
||||
| `Title2` | *string* | :heavy_check_mark: | N/A | By Genre |
|
||||
| `ViewGroup` | *string* | :heavy_check_mark: | N/A | secondary |
|
||||
| `Directory` | [][operations.GetGenresLibraryDirectory](../../models/operations/getgenreslibrarydirectory.md) | :heavy_minus_sign: | N/A | |
|
||||
8
docs/models/operations/getgenreslibraryrequest.md
Normal file
8
docs/models/operations/getgenreslibraryrequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetGenresLibraryRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
11
docs/models/operations/getgenreslibraryresponse.md
Normal file
11
docs/models/operations/getgenreslibraryresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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. |
|
||||
10
docs/models/operations/getgenreslibraryresponsebody.md
Normal file
10
docs/models/operations/getgenreslibraryresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetGenresLibraryResponseBody
|
||||
|
||||
Successful response containing media container data.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `MediaContainer` | [*operations.GetGenresLibraryMediaContainer](../../models/operations/getgenreslibrarymediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -9,6 +9,6 @@
|
||||
| `Offset` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `TotalSize` | **int* | :heavy_minus_sign: | N/A | |
|
||||
| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library |
|
||||
| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | |
|
||||
| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false |
|
||||
| `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`.<br/> | |
|
||||
| `Metadata` | [][operations.GetRecentlyAddedMetadata](../../models/operations/getrecentlyaddedmetadata.md) | :heavy_minus_sign: | N/A | |
|
||||
@@ -36,4 +36,4 @@
|
||||
| `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.User](../../models/operations/user.md) | :heavy_minus_sign: | N/A | |
|
||||
| `User` | [][operations.GetTopWatchedContentUser](../../models/operations/gettopwatchedcontentuser.md) | :heavy_minus_sign: | N/A | |
|
||||
8
docs/models/operations/gettopwatchedcontentuser.md
Normal file
8
docs/models/operations/gettopwatchedcontentuser.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetTopWatchedContentUser
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `ID` | **int* | :heavy_minus_sign: | N/A | 220 |
|
||||
15
docs/models/operations/getusersmediacontainer.md
Normal file
15
docs/models/operations/getusersmediacontainer.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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. | |
|
||||
20
docs/models/operations/getusersrequest.md
Normal file
20
docs/models/operations/getusersrequest.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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 |
|
||||
11
docs/models/operations/getusersresponse.md
Normal file
11
docs/models/operations/getusersresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
10
docs/models/operations/getusersresponsebody.md
Normal file
10
docs/models/operations/getusersresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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. |
|
||||
16
docs/models/operations/getusersserver.md
Normal file
16
docs/models/operations/getusersserver.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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 |
|
||||
11
docs/models/operations/home.md
Normal file
11
docs/models/operations/home.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Home
|
||||
|
||||
Indicates if the user is part of a home group.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `HomeDisable` | 0 |
|
||||
| `HomeEnable` | 1 |
|
||||
11
docs/models/operations/owned.md
Normal file
11
docs/models/operations/owned.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Owned
|
||||
|
||||
Indicates if the user owns the server.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------- | -------------- |
|
||||
| `OwnedDisable` | 0 |
|
||||
| `OwnedEnable` | 1 |
|
||||
11
docs/models/operations/pending.md
Normal file
11
docs/models/operations/pending.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Pending
|
||||
|
||||
Indicates if the server is pending approval.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------------- | ---------------- |
|
||||
| `PendingDisable` | 0 |
|
||||
| `PendingEnable` | 1 |
|
||||
11
docs/models/operations/protected.md
Normal file
11
docs/models/operations/protected.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Protected
|
||||
|
||||
Indicates whether the account is protected.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------ | ------------------ |
|
||||
| `ProtectedDisable` | 0 |
|
||||
| `ProtectedEnable` | 1 |
|
||||
11
docs/models/operations/restricted.md
Normal file
11
docs/models/operations/restricted.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Restricted
|
||||
|
||||
Indicates if the user has restricted access.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------- | ------------------- |
|
||||
| `RestrictedDisable` | 0 |
|
||||
| `RestrictedEnable` | 1 |
|
||||
@@ -3,6 +3,25 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `ID` | **int* | :heavy_minus_sign: | N/A | 220 |
|
||||
| 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. | |
|
||||
11
docs/models/sdkerrors/getcountrieslibrarybadrequest.md
Normal file
11
docs/models/sdkerrors/getcountrieslibrarybadrequest.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getcountrieslibraryerrors.md
Normal file
10
docs/models/sdkerrors/getcountrieslibraryerrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md
Normal file
10
docs/models/sdkerrors/getcountrieslibrarylibraryerrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
11
docs/models/sdkerrors/getcountrieslibraryunauthorized.md
Normal file
11
docs/models/sdkerrors/getcountrieslibraryunauthorized.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
11
docs/models/sdkerrors/getgenreslibrarybadrequest.md
Normal file
11
docs/models/sdkerrors/getgenreslibrarybadrequest.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getgenreslibraryerrors.md
Normal file
10
docs/models/sdkerrors/getgenreslibraryerrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getgenreslibrarylibraryerrors.md
Normal file
10
docs/models/sdkerrors/getgenreslibrarylibraryerrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
11
docs/models/sdkerrors/getgenreslibraryunauthorized.md
Normal file
11
docs/models/sdkerrors/getgenreslibraryunauthorized.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
11
docs/models/sdkerrors/getusersbadrequest.md
Normal file
11
docs/models/sdkerrors/getusersbadrequest.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getuserserrors.md
Normal file
10
docs/models/sdkerrors/getuserserrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
11
docs/models/sdkerrors/getusersunauthorized.md
Normal file
11
docs/models/sdkerrors/getusersunauthorized.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
10
docs/models/sdkerrors/getusersuserserrors.md
Normal file
10
docs/models/sdkerrors/getusersuserserrors.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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 |
|
||||
@@ -203,7 +203,6 @@ func main() {
|
||||
RequestBody: &operations.PostUsersSignInDataRequestBody{
|
||||
Login: "username@email.com",
|
||||
Password: "password123",
|
||||
RememberMe: plexgo.Bool(false),
|
||||
VerificationCode: plexgo.String("123456"),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -93,9 +93,6 @@ func main() {
|
||||
ContentDirectoryID: 470161,
|
||||
SectionID: plexgo.Int64(2),
|
||||
Type: operations.TypeTvShow,
|
||||
IncludeMeta: operations.IncludeMetaEnable.ToPointer(),
|
||||
XPlexContainerStart: plexgo.Int(0),
|
||||
XPlexContainerSize: plexgo.Int(50),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -16,6 +16,8 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [GetLibraryItems](#getlibraryitems) - Get Library Items
|
||||
* [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
|
||||
* [GetSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
|
||||
* [GetMetaDataByRatingKey](#getmetadatabyratingkey) - Get Metadata by RatingKey
|
||||
* [GetMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||
@@ -117,9 +119,6 @@ func main() {
|
||||
},
|
||||
SectionID: plexgo.Int64(2),
|
||||
Type: operations.QueryParamTypeTvShow,
|
||||
IncludeMeta: operations.QueryParamIncludeMetaEnable.ToPointer(),
|
||||
XPlexContainerStart: plexgo.Int(0),
|
||||
XPlexContainerSize: plexgo.Int(50),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -258,7 +257,6 @@ package main
|
||||
import(
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"log"
|
||||
)
|
||||
|
||||
@@ -269,7 +267,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer())
|
||||
res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -398,12 +396,8 @@ func main() {
|
||||
|
||||
res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{
|
||||
Tag: operations.TagEdition,
|
||||
IncludeGuids: operations.IncludeGuidsEnable.ToPointer(),
|
||||
Type: operations.GetLibraryItemsQueryParamTypeTvShow.ToPointer(),
|
||||
SectionKey: 9518,
|
||||
IncludeMeta: operations.GetLibraryItemsQueryParamIncludeMetaEnable.ToPointer(),
|
||||
XPlexContainerStart: plexgo.Int(0),
|
||||
XPlexContainerSize: plexgo.Int(50),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -561,6 +555,112 @@ func main() {
|
||||
| sdkerrors.GetSearchLibraryUnauthorized | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## GetGenresLibrary
|
||||
|
||||
Retrieves a list of all the genres that are found for the media in this library.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import(
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Library.GetGenresLibrary(ctx, 9518)
|
||||
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. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `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"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Library.GetCountriesLibrary(ctx, 9518)
|
||||
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. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
|
||||
| `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 | \*/\* |
|
||||
|
||||
## GetSearchAllLibraries
|
||||
|
||||
Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
|
||||
@@ -591,8 +691,6 @@ func main() {
|
||||
SearchTypes: []operations.SearchTypes{
|
||||
operations.SearchTypesPeople,
|
||||
},
|
||||
IncludeCollections: operations.QueryParamIncludeCollectionsEnable.ToPointer(),
|
||||
IncludeExternalMedia: operations.QueryParamIncludeExternalMediaEnable.ToPointer(),
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -230,7 +230,6 @@ package main
|
||||
import(
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"log"
|
||||
)
|
||||
|
||||
@@ -241,7 +240,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Plex.GetServerResources(ctx, "3381b62b-9ab7-4e37-827b-203e9809eb58", operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer())
|
||||
res, err := s.Plex.GetServerResources(ctx, "3381b62b-9ab7-4e37-827b-203e9809eb58", nil, nil, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -296,7 +295,6 @@ func main() {
|
||||
s := plexgo.New()
|
||||
|
||||
res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{
|
||||
Strong: plexgo.Bool(false),
|
||||
ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
ClientName: plexgo.String("Plex for Roku"),
|
||||
DeviceNickname: plexgo.String("Roku 3"),
|
||||
|
||||
@@ -46,7 +46,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Search.PerformSearch(ctx, "dylan", nil, plexgo.Float64(5))
|
||||
res, err := s.Search.PerformSearch(ctx, "dylan", nil, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Search.PerformVoiceSearch(ctx, "dead+poop", nil, plexgo.Float64(5))
|
||||
res, err := s.Search.PerformVoiceSearch(ctx, "dead+poop", nil, nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
73
docs/sdks/users/README.md
Normal file
73
docs/sdks/users/README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# 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.String("Plex for Roku"),
|
||||
DeviceNickname: plexgo.String("Roku 3"),
|
||||
DeviceName: plexgo.String("Chrome"),
|
||||
DeviceScreenResolution: plexgo.String("1487x1165,2560x1440"),
|
||||
ClientVersion: plexgo.String("2.4.1"),
|
||||
Platform: plexgo.String("Roku"),
|
||||
ClientFeatures: plexgo.String("external-media,indirect-media,hub-style-list"),
|
||||
Model: plexgo.String("4200X"),
|
||||
XPlexSessionID: plexgo.String("97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"),
|
||||
XPlexLanguage: plexgo.String("en"),
|
||||
PlatformVersion: plexgo.String("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 | \*/\* |
|
||||
@@ -35,8 +35,6 @@ func main() {
|
||||
|
||||
res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{
|
||||
Filter: operations.FilterAvailable,
|
||||
XPlexContainerStart: plexgo.Int(0),
|
||||
XPlexContainerSize: plexgo.Int(50),
|
||||
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -65,6 +65,12 @@ func populateQueryParams(queryParams interface{}, globals interface{}, values ur
|
||||
continue
|
||||
}
|
||||
|
||||
constValue := parseConstTag(fieldType)
|
||||
if constValue != nil {
|
||||
values.Add(qpTag.ParamName, *constValue)
|
||||
continue
|
||||
}
|
||||
|
||||
if globals != nil {
|
||||
var globalFound bool
|
||||
fieldType, valType, globalFound = populateFromGlobals(fieldType, valType, queryParamTagKey, globals)
|
||||
|
||||
@@ -96,6 +96,16 @@ func AsSecuritySource(security interface{}) func(context.Context) (interface{},
|
||||
}
|
||||
}
|
||||
|
||||
func parseConstTag(field reflect.StructField) *string {
|
||||
value := field.Tag.Get("const")
|
||||
|
||||
if value == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &value
|
||||
}
|
||||
|
||||
func parseStructTag(tagKey string, field reflect.StructField) map[string]string {
|
||||
tag := field.Tag.Get(tagKey)
|
||||
if tag == "" {
|
||||
|
||||
500
library.go
500
library.go
@@ -2046,6 +2046,506 @@ func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ op
|
||||
|
||||
}
|
||||
|
||||
// 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, opts ...operations.Option) (*operations.GetGenresLibraryResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "get-genres-library",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.GetGenresLibraryRequest{
|
||||
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}/genre", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", 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, "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 {
|
||||
copyBody, err := req.GetBody()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Body = copyBody
|
||||
}
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||
}
|
||||
return httpRes, err
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if _httpRes != nil {
|
||||
httpRes = _httpRes
|
||||
}
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.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, opts ...operations.Option) (*operations.GetCountriesLibraryResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "get-countries-library",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
request := operations.GetCountriesLibraryRequest{
|
||||
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}/country", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", 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, "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 {
|
||||
copyBody, err := req.GetBody()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Body = copyBody
|
||||
}
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||
}
|
||||
return httpRes, err
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if _httpRes != nil {
|
||||
httpRes = _httpRes
|
||||
}
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.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
|
||||
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
||||
222
models/operations/getcountrieslibrary.go
Normal file
222
models/operations/getcountrieslibrary.go
Normal file
@@ -0,0 +1,222 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryRequest) GetSectionKey() int {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.SectionKey
|
||||
}
|
||||
|
||||
type GetCountriesLibraryDirectory struct {
|
||||
FastKey string `json:"fastKey"`
|
||||
Key string `json:"key"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryDirectory) GetFastKey() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.FastKey
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryDirectory) GetKey() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Key
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryDirectory) GetTitle() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title
|
||||
}
|
||||
|
||||
type GetCountriesLibraryMediaContainer struct {
|
||||
Size float64 `json:"size"`
|
||||
Offset *int `json:"offset,omitempty"`
|
||||
TotalSize *int `json:"totalSize,omitempty"`
|
||||
Identifier string `json:"identifier"`
|
||||
AllowSync bool `json:"allowSync"`
|
||||
Art string `json:"art"`
|
||||
Content string `json:"content"`
|
||||
MediaTagPrefix string `json:"mediaTagPrefix"`
|
||||
MediaTagVersion int64 `json:"mediaTagVersion"`
|
||||
Nocache bool `json:"nocache"`
|
||||
Thumb string `json:"thumb"`
|
||||
Title1 string `json:"title1"`
|
||||
Title2 string `json:"title2"`
|
||||
ViewGroup string `json:"viewGroup"`
|
||||
Directory []GetCountriesLibraryDirectory `json:"Directory,omitempty"`
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetSize() float64 {
|
||||
if o == nil {
|
||||
return 0.0
|
||||
}
|
||||
return o.Size
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetOffset() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Offset
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetTotalSize() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.TotalSize
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetIdentifier() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Identifier
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetAllowSync() bool {
|
||||
if o == nil {
|
||||
return false
|
||||
}
|
||||
return o.AllowSync
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetArt() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Art
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetContent() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Content
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetMediaTagPrefix() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.MediaTagPrefix
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetMediaTagVersion() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.MediaTagVersion
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetNocache() bool {
|
||||
if o == nil {
|
||||
return false
|
||||
}
|
||||
return o.Nocache
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetThumb() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Thumb
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetTitle1() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title1
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetTitle2() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title2
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetViewGroup() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ViewGroup
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryMediaContainer) GetDirectory() []GetCountriesLibraryDirectory {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Directory
|
||||
}
|
||||
|
||||
// GetCountriesLibraryResponseBody - Successful response containing media container data.
|
||||
type GetCountriesLibraryResponseBody struct {
|
||||
MediaContainer *GetCountriesLibraryMediaContainer `json:"MediaContainer,omitempty"`
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryResponseBody) GetMediaContainer() *GetCountriesLibraryMediaContainer {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetCountriesLibraryResponse) GetContentType() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ContentType
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryResponse) GetStatusCode() int {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.StatusCode
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryResponse) GetRawResponse() *http.Response {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.RawResponse
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryResponse) GetObject() *GetCountriesLibraryResponseBody {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Object
|
||||
}
|
||||
230
models/operations/getgenreslibrary.go
Normal file
230
models/operations/getgenreslibrary.go
Normal file
@@ -0,0 +1,230 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryRequest) GetSectionKey() int {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.SectionKey
|
||||
}
|
||||
|
||||
type GetGenresLibraryDirectory struct {
|
||||
FastKey string `json:"fastKey"`
|
||||
Key string `json:"key"`
|
||||
Title string `json:"title"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryDirectory) GetFastKey() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.FastKey
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryDirectory) GetKey() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Key
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryDirectory) GetTitle() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryDirectory) GetType() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Type
|
||||
}
|
||||
|
||||
type GetGenresLibraryMediaContainer struct {
|
||||
Size float64 `json:"size"`
|
||||
Offset *int `json:"offset,omitempty"`
|
||||
TotalSize *int `json:"totalSize,omitempty"`
|
||||
Identifier string `json:"identifier"`
|
||||
AllowSync bool `json:"allowSync"`
|
||||
Art string `json:"art"`
|
||||
Content string `json:"content"`
|
||||
MediaTagPrefix string `json:"mediaTagPrefix"`
|
||||
MediaTagVersion int64 `json:"mediaTagVersion"`
|
||||
Nocache bool `json:"nocache"`
|
||||
Thumb string `json:"thumb"`
|
||||
Title1 string `json:"title1"`
|
||||
Title2 string `json:"title2"`
|
||||
ViewGroup string `json:"viewGroup"`
|
||||
Directory []GetGenresLibraryDirectory `json:"Directory,omitempty"`
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetSize() float64 {
|
||||
if o == nil {
|
||||
return 0.0
|
||||
}
|
||||
return o.Size
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetOffset() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Offset
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetTotalSize() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.TotalSize
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetIdentifier() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Identifier
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetAllowSync() bool {
|
||||
if o == nil {
|
||||
return false
|
||||
}
|
||||
return o.AllowSync
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetArt() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Art
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetContent() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Content
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetMediaTagPrefix() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.MediaTagPrefix
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetMediaTagVersion() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.MediaTagVersion
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetNocache() bool {
|
||||
if o == nil {
|
||||
return false
|
||||
}
|
||||
return o.Nocache
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetThumb() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Thumb
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetTitle1() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title1
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetTitle2() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title2
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetViewGroup() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ViewGroup
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryMediaContainer) GetDirectory() []GetGenresLibraryDirectory {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Directory
|
||||
}
|
||||
|
||||
// GetGenresLibraryResponseBody - Successful response containing media container data.
|
||||
type GetGenresLibraryResponseBody struct {
|
||||
MediaContainer *GetGenresLibraryMediaContainer `json:"MediaContainer,omitempty"`
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryResponseBody) GetMediaContainer() *GetGenresLibraryMediaContainer {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetGenresLibraryResponse) GetContentType() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ContentType
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryResponse) GetStatusCode() int {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.StatusCode
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryResponse) GetRawResponse() *http.Response {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.RawResponse
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryResponse) GetObject() *GetGenresLibraryResponseBody {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Object
|
||||
}
|
||||
@@ -201,11 +201,11 @@ func (o *GetTopWatchedContentRole) GetThumb() *string {
|
||||
return o.Thumb
|
||||
}
|
||||
|
||||
type User struct {
|
||||
type GetTopWatchedContentUser struct {
|
||||
ID *int `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (o *User) GetID() *int {
|
||||
func (o *GetTopWatchedContentUser) GetID() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -244,7 +244,7 @@ type GetTopWatchedContentMetadata struct {
|
||||
Country []GetTopWatchedContentCountry `json:"Country,omitempty"`
|
||||
Guids []GetTopWatchedContentGuids `json:"Guid,omitempty"`
|
||||
Role []GetTopWatchedContentRole `json:"Role,omitempty"`
|
||||
User []User `json:"User,omitempty"`
|
||||
User []GetTopWatchedContentUser `json:"User,omitempty"`
|
||||
}
|
||||
|
||||
func (g GetTopWatchedContentMetadata) MarshalJSON() ([]byte, error) {
|
||||
@@ -475,7 +475,7 @@ func (o *GetTopWatchedContentMetadata) GetRole() []GetTopWatchedContentRole {
|
||||
return o.Role
|
||||
}
|
||||
|
||||
func (o *GetTopWatchedContentMetadata) GetUser() []User {
|
||||
func (o *GetTopWatchedContentMetadata) GetUser() []GetTopWatchedContentUser {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
816
models/operations/getusers.go
Normal file
816
models/operations/getusers.go
Normal file
@@ -0,0 +1,816 @@
|
||||
// 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 (o *GetUsersRequest) GetClientID() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ClientID
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetClientName() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.ClientName
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetDeviceNickname() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.DeviceNickname
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetDeviceName() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.DeviceName
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetDeviceScreenResolution() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.DeviceScreenResolution
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetClientVersion() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.ClientVersion
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetPlatform() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Platform
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetClientFeatures() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.ClientFeatures
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetModel() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Model
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetXPlexSessionID() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.XPlexSessionID
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetXPlexLanguage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.XPlexLanguage
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetPlatformVersion() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.PlatformVersion
|
||||
}
|
||||
|
||||
func (o *GetUsersRequest) GetXPlexToken() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.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, false); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetID() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.ID
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetServerID() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.ServerID
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetMachineIdentifier() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.MachineIdentifier
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetName() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Name
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetLastSeenAt() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.LastSeenAt
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetNumLibraries() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.NumLibraries
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetAllLibraries() *AllLibraries {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllLibraries
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetOwned() *Owned {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Owned
|
||||
}
|
||||
|
||||
func (o *GetUsersServer) GetPending() *Pending {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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, false); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *User) GetID() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.ID
|
||||
}
|
||||
|
||||
func (o *User) GetTitle() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Title
|
||||
}
|
||||
|
||||
func (o *User) GetUsername() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Username
|
||||
}
|
||||
|
||||
func (o *User) GetEmail() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Email
|
||||
}
|
||||
|
||||
func (o *User) GetRecommendationsPlaylistID() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.RecommendationsPlaylistID
|
||||
}
|
||||
|
||||
func (o *User) GetThumb() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Thumb
|
||||
}
|
||||
|
||||
func (o *User) GetProtected() *Protected {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Protected
|
||||
}
|
||||
|
||||
func (o *User) GetHome() *Home {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Home
|
||||
}
|
||||
|
||||
func (o *User) GetAllowTuners() *AllowTuners {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllowTuners
|
||||
}
|
||||
|
||||
func (o *User) GetAllowSync() *AllowSync {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllowSync
|
||||
}
|
||||
|
||||
func (o *User) GetAllowCameraUpload() *AllowCameraUpload {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllowCameraUpload
|
||||
}
|
||||
|
||||
func (o *User) GetAllowChannels() *AllowChannels {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllowChannels
|
||||
}
|
||||
|
||||
func (o *User) GetAllowSubtitleAdmin() *AllowSubtitleAdmin {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.AllowSubtitleAdmin
|
||||
}
|
||||
|
||||
func (o *User) GetFilterAll() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.FilterAll
|
||||
}
|
||||
|
||||
func (o *User) GetFilterMovies() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.FilterMovies
|
||||
}
|
||||
|
||||
func (o *User) GetFilterMusic() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.FilterMusic
|
||||
}
|
||||
|
||||
func (o *User) GetFilterPhotos() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.FilterPhotos
|
||||
}
|
||||
|
||||
func (o *User) GetFilterTelevision() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.FilterTelevision
|
||||
}
|
||||
|
||||
func (o *User) GetRestricted() *Restricted {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Restricted
|
||||
}
|
||||
|
||||
func (o *User) GetServer() []GetUsersServer {
|
||||
if o == nil {
|
||||
return []GetUsersServer{}
|
||||
}
|
||||
return o.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 (o *GetUsersMediaContainer) GetFriendlyName() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.FriendlyName
|
||||
}
|
||||
|
||||
func (o *GetUsersMediaContainer) GetIdentifier() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.Identifier
|
||||
}
|
||||
|
||||
func (o *GetUsersMediaContainer) GetMachineIdentifier() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.MachineIdentifier
|
||||
}
|
||||
|
||||
func (o *GetUsersMediaContainer) GetTotalSize() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.TotalSize
|
||||
}
|
||||
|
||||
func (o *GetUsersMediaContainer) GetSize() int64 {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.Size
|
||||
}
|
||||
|
||||
func (o *GetUsersMediaContainer) GetUser() []User {
|
||||
if o == nil {
|
||||
return []User{}
|
||||
}
|
||||
return o.User
|
||||
}
|
||||
|
||||
// GetUsersResponseBody - Successful response with media container data in XML
|
||||
type GetUsersResponseBody struct {
|
||||
// Container holding user and server details.
|
||||
MediaContainer *GetUsersMediaContainer
|
||||
}
|
||||
|
||||
func (o *GetUsersResponseBody) GetMediaContainer() *GetUsersMediaContainer {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetUsersResponse) GetContentType() string {
|
||||
if o == nil {
|
||||
return ""
|
||||
}
|
||||
return o.ContentType
|
||||
}
|
||||
|
||||
func (o *GetUsersResponse) GetStatusCode() int {
|
||||
if o == nil {
|
||||
return 0
|
||||
}
|
||||
return o.StatusCode
|
||||
}
|
||||
|
||||
func (o *GetUsersResponse) GetRawResponse() *http.Response {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.RawResponse
|
||||
}
|
||||
|
||||
func (o *GetUsersResponse) GetBody() []byte {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Body
|
||||
}
|
||||
@@ -23,6 +23,7 @@ type AcceptHeaderEnum string
|
||||
const (
|
||||
AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json"
|
||||
AcceptHeaderEnumImageJpeg AcceptHeaderEnum = "image/jpeg"
|
||||
AcceptHeaderEnumApplicationXml AcceptHeaderEnum = "application/xml"
|
||||
)
|
||||
|
||||
func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum {
|
||||
|
||||
90
models/sdkerrors/getcountrieslibrary.go
Normal file
90
models/sdkerrors/getcountrieslibrary.go
Normal file
@@ -0,0 +1,90 @@
|
||||
// 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 (o *GetCountriesLibraryLibraryErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryLibraryErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryLibraryErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetCountriesLibraryErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetCountriesLibraryErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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)
|
||||
}
|
||||
90
models/sdkerrors/getgenreslibrary.go
Normal file
90
models/sdkerrors/getgenreslibrary.go
Normal file
@@ -0,0 +1,90 @@
|
||||
// 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 (o *GetGenresLibraryLibraryErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryLibraryErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryLibraryErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetGenresLibraryErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetGenresLibraryErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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)
|
||||
}
|
||||
90
models/sdkerrors/getusers.go
Normal file
90
models/sdkerrors/getusers.go
Normal file
@@ -0,0 +1,90 @@
|
||||
// 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 (o *GetUsersUsersErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetUsersUsersErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetUsersUsersErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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 (o *GetUsersErrors) GetCode() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Code
|
||||
}
|
||||
|
||||
func (o *GetUsersErrors) GetMessage() *string {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.Message
|
||||
}
|
||||
|
||||
func (o *GetUsersErrors) GetStatus() *int {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.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)
|
||||
}
|
||||
@@ -154,6 +154,7 @@ type PlexAPI struct {
|
||||
// Updates to the status can be observed via the Event API.
|
||||
//
|
||||
Updater *Updater
|
||||
Users *Users
|
||||
|
||||
sdkConfiguration sdkConfiguration
|
||||
}
|
||||
@@ -298,9 +299,9 @@ func New(opts ...SDKOption) *PlexAPI {
|
||||
sdkConfiguration: sdkConfiguration{
|
||||
Language: "go",
|
||||
OpenAPIDocVersion: "0.0.3",
|
||||
SDKVersion: "0.17.3",
|
||||
GenVersion: "2.495.1",
|
||||
UserAgent: "speakeasy-sdk/go 0.17.3 2.495.1 0.0.3 github.com/LukeHagar/plexgo",
|
||||
SDKVersion: "0.18.0",
|
||||
GenVersion: "2.506.0",
|
||||
UserAgent: "speakeasy-sdk/go 0.18.0 2.506.0 0.0.3 github.com/LukeHagar/plexgo",
|
||||
ServerDefaults: []map[string]string{
|
||||
{
|
||||
"protocol": "https",
|
||||
@@ -359,5 +360,7 @@ func New(opts ...SDKOption) *PlexAPI {
|
||||
|
||||
sdk.Updater = newUpdater(sdk.sdkConfiguration)
|
||||
|
||||
sdk.Users = newUsers(sdk.sdkConfiguration)
|
||||
|
||||
return sdk
|
||||
}
|
||||
|
||||
@@ -712,15 +712,15 @@ func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight,
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode == 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
rawBody, err := 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:
|
||||
case httpRes.StatusCode == 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
262
users.go
Normal file
262
users.go
Normal file
@@ -0,0 +1,262 @@
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
package plexgo
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"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 {
|
||||
sdkConfiguration sdkConfiguration
|
||||
}
|
||||
|
||||
func newUsers(sdkConfig sdkConfiguration) *Users {
|
||||
return &Users{
|
||||
sdkConfiguration: sdkConfig,
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
OperationID: "get-users",
|
||||
OAuth2Scopes: []string{},
|
||||
SecuritySource: nil,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
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)
|
||||
}
|
||||
|
||||
timeout := o.Timeout
|
||||
if timeout == nil {
|
||||
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 {
|
||||
copyBody, err := req.GetBody()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Body = copyBody
|
||||
}
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
|
||||
}
|
||||
return httpRes, err
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
httpRes, err = s.sdkConfiguration.Client.Do(req)
|
||||
if err != nil || httpRes == nil {
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error sending request: %w", err)
|
||||
} else {
|
||||
err = fmt.Errorf("error sending request: no response")
|
||||
}
|
||||
|
||||
_, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if _httpRes != nil {
|
||||
httpRes = _httpRes
|
||||
}
|
||||
} else {
|
||||
httpRes, err = s.sdkConfiguration.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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user