From d7fe60ed91c4329c84cf364ed5348fdb3161aaa4 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 4 May 2024 00:47:01 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.279.0 --- .speakeasy/gen.lock | 10 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 2 +- RELEASES.md | 12 +- codeSamples.yaml | 2615 +++++++++-------- docs/models/operations/applyupdatesrequest.md | 8 +- .../cancelserveractivitiesrequest.md | 6 +- .../operations/checkforupdatesrequest.md | 6 +- .../models/operations/getstatisticsrequest.md | 6 +- docs/models/operations/gettimelinerequest.md | 24 +- .../startuniversaltranscoderequest.md | 36 +- .../operations/updateplayprogressrequest.md | 10 +- docs/sdks/activities/README.md | 10 +- docs/sdks/media/README.md | 16 +- docs/sdks/statistics/README.md | 10 +- docs/sdks/updater/README.md | 20 +- docs/sdks/video/README.md | 41 +- internal/utils/json.go | 74 + plexapi.go | 6 +- 19 files changed, 1510 insertions(+), 1404 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 714e4b5..8e7de42 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 management: docChecksum: 7a43cd3413d535205cfaee20a4b6a250 docVersion: 0.0.3 - speakeasyVersion: 1.277.8 - generationVersion: 2.319.10 - releaseVersion: 0.6.6 - configChecksum: f8398b860184344aa6c067b6ffd710a4 + speakeasyVersion: 1.279.0 + generationVersion: 2.322.5 + releaseVersion: 0.6.7 + configChecksum: 78af15bfd6f8be83ea08e1ad8e8c4ace repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo @@ -21,7 +21,7 @@ features: globals: 2.82.2 methodServerURLs: 2.82.1 nameOverrides: 2.81.2 - responseFormat: 0.1.0 + responseFormat: 0.1.1 generatedFiles: - server.go - media.go diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a077273..17d77e9 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.6.6 + version: 0.6.7 additionalDependencies: {} clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0573d06..a89d723 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.277.8 +speakeasyVersion: 1.279.0 sources: {} targets: {} workflow: diff --git a/RELEASES.md b/RELEASES.md index bc44777..6086db8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -342,4 +342,14 @@ Based on: ### Generated - [go v0.6.6] . ### Releases -- [Go v0.6.6] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.6 - . \ No newline at end of file +- [Go v0.6.6] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.6 - . + +## 2024-05-04 00:46:06 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.279.0 (2.322.5) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.6.7] . +### Releases +- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 5612290..bc1d169 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/:/progress"]["post"] + - target: $["paths"]["/playlists/{playlistID}"]["get"] update: x-codeSamples: - lang: go - label: updatePlayProgress + label: getPlaylist source: |- package main @@ -25,14 +25,1194 @@ actions: ) - var key string = "" - - var time float64 = 6900.91 - - var state string = "" + var playlistID float64 = 4109.48 ctx := context.Background() - res, err := s.UpdatePlayProgress(ctx, key, time, state) + res, err := s.GetPlaylist(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/pins/{pinID}"]["get"] + update: + x-codeSamples: + - lang: go + label: getToken + source: |- + package main + + import( + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var pinID string = "" + + var xPlexClientIdentifier *string = plexgo.String("Postman") + + ctx := context.Background() + res, err := s.GetToken(ctx, pinID, xPlexClientIdentifier) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistID}"]["put"] + update: + x-codeSamples: + - lang: go + label: updatePlaylist + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var playlistID float64 = 3915 + + var title *string = plexgo.String("") + + var summary *string = plexgo.String("") + + ctx := context.Background() + res, err := s.UpdatePlaylist(ctx, playlistID, title, summary) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/"]["get"] + update: + x-codeSamples: + - lang: go + label: getServerCapabilities + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/recentlyAdded"]["get"] + update: + x-codeSamples: + - lang: go + label: getRecentlyAdded + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetRecentlyAdded(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/butler"]["delete"] + update: + x-codeSamples: + - lang: go + label: stopAllTasks + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.StopAllTasks(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/:/prefs"]["get"] + update: + x-codeSamples: + - lang: go + label: getServerPreferences + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetServerPreferences(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/search"]["get"] + update: + x-codeSamples: + - lang: go + label: getSearchResults + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var query string = "110" + + ctx := context.Background() + res, err := s.GetSearchResults(ctx, query) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists"]["get"] + update: + x-codeSamples: + - lang: go + label: getPlaylists + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio.ToPointer() + + var smart *operations.QueryParamSmart = operations.QueryParamSmartZero.ToPointer() + + ctx := context.Background() + res, err := s.GetPlaylists(ctx, playlistType, smart) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + update: + x-codeSamples: + - lang: go + label: stopTranscodeSession + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var sessionKey string = "zz7llzqlx8w9vnrsbnwhbmep" + + ctx := context.Background() + res, err := s.StopTranscodeSession(ctx, sessionKey) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/updater/apply"]["put"] + update: + x-codeSamples: + - lang: go + label: applyUpdates + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var tonight *operations.Tonight = operations.TonightOne.ToPointer() + + var skip *operations.Skip = operations.SkipOne.ToPointer() + + ctx := context.Background() + res, err := s.ApplyUpdates(ctx, tonight, skip) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/servers"]["get"] + update: + x-codeSamples: + - lang: go + label: getServerList + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetServerList(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/butler"]["get"] + update: + x-codeSamples: + - lang: go + label: getButlerTasks + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetButlerTasks(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + update: + x-codeSamples: + - lang: go + label: getMetadataChildren + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var ratingKey float64 = 1539.14 + + ctx := context.Background() + res, err := s.GetMetadataChildren(ctx, ratingKey) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: go + label: uploadPlaylist + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var path string = "/home/barkley/playlist.m3u" + + var force operations.Force = operations.ForceZero + + ctx := context.Background() + res, err := s.UploadPlaylist(ctx, path, force) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/security/token"]["get"] + update: + x-codeSamples: + - lang: go + label: getTransientToken + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation + + var scope operations.Scope = operations.ScopeAll + + ctx := context.Background() + res, err := s.GetTransientToken(ctx, type_, scope) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/:/unscrobble"]["get"] + update: + x-codeSamples: + - lang: go + label: markUnplayed + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var key float64 = 59398 + + ctx := context.Background() + res, err := s.MarkUnplayed(ctx, key) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections"]["get"] + update: + x-codeSamples: + - lang: go + label: getLibraries + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetLibraries(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistID}"]["delete"] + update: + x-codeSamples: + - lang: go + label: deletePlaylist + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var playlistID float64 = 216.22 + + ctx := context.Background() + res, err := s.DeletePlaylist(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/security/resources"]["get"] + update: + x-codeSamples: + - lang: go + label: getSourceConnectionInformation + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var source string = "server://client-identifier" + + ctx := context.Background() + res, err := s.GetSourceConnectionInformation(ctx, source) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/status/sessions/history/all"]["get"] + update: + x-codeSamples: + - lang: go + label: getSessionHistory + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetSessionHistory(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/:/scrobble"]["get"] + update: + x-codeSamples: + - lang: go + label: markPlayed + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var key float64 = 59398 + + ctx := context.Background() + res, err := s.MarkPlayed(ctx, key) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/log"]["post"] + update: + x-codeSamples: + - lang: go + label: logMultiLine + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman + level=3&message=Test%20message%202&source=postman + level=1&message=Test%20message%203&source=postman") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] + update: + x-codeSamples: + - lang: go + label: getMetadata + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var ratingKey float64 = 8382.31 + + ctx := context.Background() + res, err := s.GetMetadata(ctx, ratingKey) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/updater/check"]["put"] + update: + x-codeSamples: + - lang: go + label: checkForUpdates + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var download *operations.Download = operations.DownloadOne.ToPointer() + + ctx := context.Background() + res, err := s.CheckForUpdates(ctx, download) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] + update: + x-codeSamples: + - lang: go + label: searchLibrary + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var sectionID int64 = 933505 + + var type_ operations.Type = operations.TypeFour + + ctx := context.Background() + res, err := s.SearchLibrary(ctx, sectionID, type_) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/statistics/media"]["get"] + update: + x-codeSamples: + - lang: go + label: getStatistics + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var timespan *int64 = plexgo.Int64(4) + + ctx := context.Background() + res, err := s.GetStatistics(ctx, timespan) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/clients"]["get"] + update: + x-codeSamples: + - lang: go + label: getAvailableClients + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetAvailableClients(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/activities/{activityUUID}"]["delete"] + update: + x-codeSamples: + - lang: go + label: cancelServerActivities + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var activityUUID string = "25b71ed5-0f9d-461c-baa7-d404e9e10d3e" + + ctx := context.Background() + res, err := s.CancelServerActivities(ctx, activityUUID) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] + update: + x-codeSamples: + - lang: go + label: deleteLibrary + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var sectionID float64 = 1000 + + ctx := context.Background() + res, err := s.DeleteLibrary(ctx, sectionID) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/playlists"]["post"] + update: + x-codeSamples: + - lang: go + label: createPlaylist + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "github.com/LukeHagar/plexgo/models/operations" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ + Title: "", + Type: operations.QueryParamTypePhoto, + Smart: operations.SmartOne, + URI: "https://inborn-brochure.biz", + }) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/butler"]["post"] + update: + x-codeSamples: + - lang: go + label: startAllTasks + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.StartAllTasks(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}"]["get"] + update: + x-codeSamples: + - lang: go + label: getLibrary + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var sectionID float64 = 1000 + + var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer() + + ctx := context.Background() + res, err := s.GetLibrary(ctx, sectionID, includeDetails) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + update: + x-codeSamples: + - lang: go + label: clearPlaylistContents + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var playlistID float64 = 1893.18 + + ctx := context.Background() + res, err := s.ClearPlaylistContents(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: go + label: addPlaylistContents + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var playlistID float64 = 8502.01 + + var uri string = "server://12345/com.plexapp.plugins.library/library/metadata/1" + + var playQueueID *float64 = plexgo.Float64(123) + + ctx := context.Background() + res, err := s.AddPlaylistContents(ctx, playlistID, uri, playQueueID) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/devices"]["get"] + update: + x-codeSamples: + - lang: go + label: getDevices + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + ctx := context.Background() + res, err := s.GetDevices(ctx) + if err != nil { + log.Fatal(err) + } + if res.Object != nil { + // handle response + } + } + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] + update: + x-codeSamples: + - lang: go + label: refreshLibrary + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var sectionID float64 = 934.16 + + ctx := context.Background() + res, err := s.RefreshLibrary(ctx, sectionID) if err != nil { log.Fatal(err) } @@ -76,49 +1256,11 @@ actions: // handle response } } - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] + - target: $["paths"]["/hubs/search/voice"]["get"] update: x-codeSamples: - lang: go - label: getLibraryHubs - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sectionID float64 = 6728.76 - - var count *float64 = plexgo.Float64(9010.22) - - var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero.ToPointer() - - ctx := context.Background() - res, err := s.GetLibraryHubs(ctx, sectionID, count, onlyTransient) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/updater/status"]["get"] - update: - x-codeSamples: - - lang: go - label: getUpdateStatus + label: performVoiceSearch source: |- package main @@ -135,38 +1277,15 @@ actions: plexgo.WithXPlexClientIdentifier("Postman"), ) - ctx := context.Background() - res, err := s.GetUpdateStatus(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/butler"]["post"] - update: - x-codeSamples: - - lang: go - label: startAllTasks - source: |- - package main - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) + var query string = "dead+poop" - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) + var sectionID *float64 = plexgo.Float64(4094.8) + + var limit *float64 = plexgo.Float64(5) ctx := context.Background() - res, err := s.StartAllTasks(ctx) + res, err := s.PerformVoiceSearch(ctx, query, sectionID, limit) if err != nil { log.Fatal(err) } @@ -212,11 +1331,11 @@ actions: // handle response } } - - target: $["paths"]["/"]["get"] + - target: $["paths"]["/status/sessions"]["get"] update: x-codeSamples: - lang: go - label: getServerCapabilities + label: getSessions source: |- package main @@ -234,7 +1353,7 @@ actions: ) ctx := context.Background() - res, err := s.GetServerCapabilities(ctx) + res, err := s.GetSessions(ctx) if err != nil { log.Fatal(err) } @@ -242,11 +1361,11 @@ actions: // handle response } } - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + - target: $["paths"]["/updater/status"]["get"] update: x-codeSamples: - lang: go - label: addPlaylistContents + label: getUpdateStatus source: |- package main @@ -263,15 +1382,8 @@ actions: plexgo.WithXPlexClientIdentifier("Postman"), ) - - var playlistID float64 = 8502.01 - - var uri string = "server://12345/com.plexapp.plugins.library/library/metadata/1" - - var playQueueID *float64 = plexgo.Float64(123) - ctx := context.Background() - res, err := s.AddPlaylistContents(ctx, playlistID, uri, playQueueID) + res, err := s.GetUpdateStatus(ctx) if err != nil { log.Fatal(err) } @@ -279,11 +1391,11 @@ actions: // handle response } } - - target: $["paths"]["/activities/{activityUUID}"]["delete"] + - target: $["paths"]["/:/progress"]["post"] update: x-codeSamples: - lang: go - label: cancelServerActivities + label: updatePlayProgress source: |- package main @@ -301,10 +1413,14 @@ actions: ) - var activityUUID string = "" + var key string = "" + + var time float64 = 90000 + + var state string = "played" ctx := context.Background() - res, err := s.CancelServerActivities(ctx, activityUUID) + res, err := s.UpdatePlayProgress(ctx, key, time, state) if err != nil { log.Fatal(err) } @@ -312,107 +1428,11 @@ actions: // handle response } } - - target: $["paths"]["/butler"]["get"] + - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] update: x-codeSamples: - lang: go - label: getButlerTasks - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetButlerTasks(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections"]["get"] - update: - x-codeSamples: - - lang: go - label: getLibraries - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetLibraries(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/playlists/upload"]["post"] - update: - x-codeSamples: - - lang: go - label: uploadPlaylist - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var path string = "/home/barkley/playlist.m3u" - - var force operations.Force = operations.ForceZero - - ctx := context.Background() - res, err := s.UploadPlaylist(ctx, path, force) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists"]["post"] - update: - x-codeSamples: - - lang: go - label: createPlaylist + label: startUniversalTranscode source: |- package main @@ -431,123 +1451,36 @@ actions: ) ctx := context.Background() - res, err := s.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ - Title: "", - Type: operations.QueryParamTypePhoto, - Smart: operations.SmartOne, - URI: "https://inborn-brochure.biz", + res, err := s.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ + HasMDE: 1, + Path: "/library/metadata/23409", + MediaIndex: 0, + PartIndex: 0, + Protocol: "hls", + FastSeek: plexgo.Float64(0), + DirectPlay: plexgo.Float64(0), + DirectStream: plexgo.Float64(0), + SubtitleSize: plexgo.Float64(100), + Subtites: plexgo.String("burn"), + AudioBoost: plexgo.Float64(100), + Location: plexgo.String("lan"), + MediaBufferSize: plexgo.Float64(102400), + Session: plexgo.String("zvcage8b7rkioqcm8f4uns4c"), + AddDebugOverlay: plexgo.Float64(0), + AutoAdjustQuality: plexgo.Float64(0), }) if err != nil { log.Fatal(err) } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: go - label: deletePlaylist - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var playlistID float64 = 216.22 - - ctx := context.Background() - res, err := s.DeletePlaylist(ctx, playlistID) - if err != nil { - log.Fatal(err) - } if res != nil { // handle response } } - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/activities"]["get"] update: x-codeSamples: - lang: go - label: stopTranscodeSession - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sessionKey string = "zz7llzqlx8w9vnrsbnwhbmep" - - ctx := context.Background() - res, err := s.StopTranscodeSession(ctx, sessionKey) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/search"]["get"] - update: - x-codeSamples: - - lang: go - label: getSearchResults - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var query string = "110" - - ctx := context.Background() - res, err := s.GetSearchResults(ctx, query) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: go - label: getRecentlyAdded + label: getServerActivities source: |- package main @@ -565,406 +1498,7 @@ actions: ) ctx := context.Background() - res, err := s.GetRecentlyAdded(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: go - label: getLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sectionID float64 = 1000 - - var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer() - - ctx := context.Background() - res, err := s.GetLibrary(ctx, sectionID, includeDetails) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] - update: - x-codeSamples: - - lang: go - label: deleteLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sectionID float64 = 1000 - - ctx := context.Background() - res, err := s.DeleteLibrary(ctx, sectionID) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] - update: - x-codeSamples: - - lang: go - label: searchLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sectionID int64 = 933505 - - var type_ operations.Type = operations.TypeFour - - ctx := context.Background() - res, err := s.SearchLibrary(ctx, sectionID, type_) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/onDeck"]["get"] - update: - x-codeSamples: - - lang: go - label: getOnDeck - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetOnDeck(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: go - label: getServerPreferences - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetServerPreferences(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/clients"]["get"] - update: - x-codeSamples: - - lang: go - label: getAvailableClients - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetAvailableClients(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: go - label: markPlayed - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var key float64 = 59398 - - ctx := context.Background() - res, err := s.MarkPlayed(ctx, key) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: go - label: stopTask - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase - - ctx := context.Background() - res, err := s.StopTask(ctx, taskName) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: go - label: performVoiceSearch - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var query string = "dead+poop" - - var sectionID *float64 = plexgo.Float64(4094.8) - - var limit *float64 = plexgo.Float64(5) - - ctx := context.Background() - res, err := s.PerformVoiceSearch(ctx, query, sectionID, limit) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/butler/{taskName}"]["post"] - update: - x-codeSamples: - - lang: go - label: startTask - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var taskName operations.TaskName = operations.TaskNameCleanOldBundles - - ctx := context.Background() - res, err := s.StartTask(ctx, taskName) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] - update: - x-codeSamples: - - lang: go - label: refreshLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var sectionID float64 = 934.16 - - ctx := context.Background() - res, err := s.RefreshLibrary(ctx, sectionID) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: go - label: getMetadata - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var ratingKey float64 = 8382.31 - - ctx := context.Background() - res, err := s.GetMetadata(ctx, ratingKey) + res, err := s.GetServerActivities(ctx) if err != nil { log.Fatal(err) } @@ -1007,17 +1541,18 @@ actions: // handle response } } - - target: $["paths"]["/transcode/sessions"]["get"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: go - label: getTranscodeSessions + label: getLibraryHubs source: |- package main import( "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "context" "log" ) @@ -1028,68 +1563,15 @@ actions: plexgo.WithXPlexClientIdentifier("Postman"), ) - ctx := context.Background() - res, err := s.GetTranscodeSessions(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/identity"]["get"] - update: - x-codeSamples: - - lang: go - label: getServerIdentity - source: |- - package main - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) + var sectionID float64 = 6728.76 - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) + var count *float64 = plexgo.Float64(9010.22) + + var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero.ToPointer() ctx := context.Background() - res, err := s.GetServerIdentity(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/activities"]["get"] - update: - x-codeSamples: - - lang: go - label: getServerActivities - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetServerActivities(ctx) + res, err := s.GetLibraryHubs(ctx, sectionID, count, onlyTransient) if err != nil { log.Fatal(err) } @@ -1133,11 +1615,11 @@ actions: // handle response } } - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + - target: $["paths"]["/library/onDeck"]["get"] update: x-codeSamples: - lang: go - label: getMetadataChildren + label: getOnDeck source: |- package main @@ -1154,11 +1636,8 @@ actions: plexgo.WithXPlexClientIdentifier("Postman"), ) - - var ratingKey float64 = 1539.14 - ctx := context.Background() - res, err := s.GetMetadataChildren(ctx, ratingKey) + res, err := s.GetOnDeck(ctx) if err != nil { log.Fatal(err) } @@ -1166,44 +1645,11 @@ actions: // handle response } } - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + - target: $["paths"]["/identity"]["get"] update: x-codeSamples: - lang: go - label: clearPlaylistContents - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var playlistID float64 = 1893.18 - - ctx := context.Background() - res, err := s.ClearPlaylistContents(ctx, playlistID) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/log"]["post"] - update: - x-codeSamples: - - lang: go - label: logMultiLine + label: getServerIdentity source: |- package main @@ -1221,42 +1667,7 @@ actions: ) ctx := context.Background() - res, err := s.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman") - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/statistics/media"]["get"] - update: - x-codeSamples: - - lang: go - label: getStatistics - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var timespan *int64 = plexgo.Int64(411769) - - ctx := context.Background() - res, err := s.GetStatistics(ctx, timespan) + res, err := s.GetServerIdentity(ctx) if err != nil { log.Fatal(err) } @@ -1264,11 +1675,11 @@ actions: // handle response } } - - target: $["paths"]["/status/sessions"]["get"] + - target: $["paths"]["/myplex/account"]["get"] update: x-codeSamples: - lang: go - label: getSessions + label: getMyPlexAccount source: |- package main @@ -1286,7 +1697,7 @@ actions: ) ctx := context.Background() - res, err := s.GetSessions(ctx) + res, err := s.GetMyPlexAccount(ctx) if err != nil { log.Fatal(err) } @@ -1294,135 +1705,6 @@ actions: // handle response } } - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: go - label: getTransientToken - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation - - var scope operations.Scope = operations.ScopeAll - - ctx := context.Background() - res, err := s.GetTransientToken(ctx, type_, scope) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/servers"]["get"] - update: - x-codeSamples: - - lang: go - label: getServerList - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetServerList(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: go - label: markUnplayed - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var key float64 = 59398 - - ctx := context.Background() - res, err := s.MarkUnplayed(ctx, key) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/butler"]["delete"] - update: - x-codeSamples: - - lang: go - label: stopAllTasks - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.StopAllTasks(ctx) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - target: $["paths"]["/hubs/search"]["get"] update: x-codeSamples: @@ -1490,11 +1772,11 @@ actions: // handle response } } - - target: $["paths"]["/devices"]["get"] + - target: $["paths"]["/transcode/sessions"]["get"] update: x-codeSamples: - lang: go - label: getDevices + label: getTranscodeSessions source: |- package main @@ -1512,7 +1794,7 @@ actions: ) ctx := context.Background() - res, err := s.GetDevices(ctx) + res, err := s.GetTranscodeSessions(ctx) if err != nil { log.Fatal(err) } @@ -1520,316 +1802,6 @@ actions: // handle response } } - - target: $["paths"]["/myplex/account"]["get"] - update: - x-codeSamples: - - lang: go - label: getMyPlexAccount - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.GetMyPlexAccount(ctx) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] - update: - x-codeSamples: - - lang: go - label: startUniversalTranscode - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "github.com/LukeHagar/plexgo/models/operations" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - ctx := context.Background() - res, err := s.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ - HasMDE: 8924.99, - Path: "/etc/mail", - MediaIndex: 9962.95, - PartIndex: 1232.82, - Protocol: "", - }) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/pins/{pinID}"]["get"] - update: - x-codeSamples: - - lang: go - label: getToken - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var pinID string = "" - - var xPlexClientIdentifier *string = plexgo.String("Postman") - - ctx := context.Background() - res, err := s.GetToken(ctx, pinID, xPlexClientIdentifier) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: go - label: getPlaylist - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var playlistID float64 = 4109.48 - - ctx := context.Background() - res, err := s.GetPlaylist(ctx, playlistID) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/library/hashes"]["get"] - update: - x-codeSamples: - - lang: go - label: getFileHash - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var url_ string = "file://C:\Image.png&type=13" - - var type_ *float64 = plexgo.Float64(4462.17) - - ctx := context.Background() - res, err := s.GetFileHash(ctx, url_, type_) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: go - label: getPlaylists - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio.ToPointer() - - var smart *operations.QueryParamSmart = operations.QueryParamSmartZero.ToPointer() - - ctx := context.Background() - res, err := s.GetPlaylists(ctx, playlistType, smart) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - target: $["paths"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: go - label: updatePlaylist - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var playlistID float64 = 3915 - - var title *string = plexgo.String("") - - var summary *string = plexgo.String("") - - ctx := context.Background() - res, err := s.UpdatePlaylist(ctx, playlistID, title, summary) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/updater/apply"]["put"] - update: - x-codeSamples: - - lang: go - label: applyUpdates - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var tonight *operations.Tonight = operations.TonightOne.ToPointer() - - var skip *operations.Skip = operations.SkipZero.ToPointer() - - ctx := context.Background() - res, err := s.ApplyUpdates(ctx, tonight, skip) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - target: $["paths"]["/security/resources"]["get"] - update: - x-codeSamples: - - lang: go - label: getSourceConnectionInformation - source: |- - package main - - import( - "github.com/LukeHagar/plexgo/models/components" - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - - - var source string = "server://client-identifier" - - ctx := context.Background() - res, err := s.GetSourceConnectionInformation(ctx, source) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - target: $["paths"]["/photo/:/transcode"]["get"] update: x-codeSamples: @@ -1869,19 +1841,19 @@ actions: // handle response } } - - target: $["paths"]["/:/timeline"]["get"] + - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: go - label: getTimeline + label: stopTask source: |- package main import( "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" - "context" "github.com/LukeHagar/plexgo/models/operations" + "context" "log" ) @@ -1891,19 +1863,46 @@ actions: plexgo.WithXPlexClientIdentifier("Postman"), ) + + var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase + ctx := context.Background() - res, err := s.GetTimeline(ctx, operations.GetTimelineRequest{ - RatingKey: 716.56, - Key: "", - State: operations.StatePaused, - HasMDE: 7574.33, - Time: 3327.51, - Duration: 7585.39, - Context: "", - PlayQueueItemID: 1406.21, - PlayBackTime: 2699.34, - Row: 3536.42, - }) + res, err := s.StopTask(ctx, taskName) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } + } + - target: $["paths"]["/library/hashes"]["get"] + update: + x-codeSamples: + - lang: go + label: getFileHash + source: |- + package main + + import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + ) + + func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + plexgo.WithXPlexClientIdentifier("Postman"), + ) + + + var url_ string = "file://C:\Image.png&type=13" + + var type_ *float64 = plexgo.Float64(4462.17) + + ctx := context.Background() + res, err := s.GetFileHash(ctx, url_, type_) if err != nil { log.Fatal(err) } @@ -1944,11 +1943,11 @@ actions: // handle response } } - - target: $["paths"]["/status/sessions/history/all"]["get"] + - target: $["paths"]["/:/timeline"]["get"] update: x-codeSamples: - lang: go - label: getSessionHistory + label: getTimeline source: |- package main @@ -1956,6 +1955,7 @@ actions: "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "context" + "github.com/LukeHagar/plexgo/models/operations" "log" ) @@ -1966,19 +1966,30 @@ actions: ) ctx := context.Background() - res, err := s.GetSessionHistory(ctx) + res, err := s.GetTimeline(ctx, operations.GetTimelineRequest{ + RatingKey: 23409, + Key: "/library/metadata/23409", + State: operations.StatePlaying, + HasMDE: 1, + Time: 2000, + Duration: 10000, + Context: "home:hub.continueWatching", + PlayQueueItemID: 1, + PlayBackTime: 2000, + Row: 1, + }) if err != nil { log.Fatal(err) } - if res.Object != nil { + if res != nil { // handle response } } - - target: $["paths"]["/updater/check"]["put"] + - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: go - label: checkForUpdates + label: startTask source: |- package main @@ -1997,10 +2008,10 @@ actions: ) - var download *operations.Download = operations.DownloadOne.ToPointer() + var taskName operations.TaskName = operations.TaskNameCleanOldBundles ctx := context.Background() - res, err := s.CheckForUpdates(ctx, download) + res, err := s.StartTask(ctx, taskName) if err != nil { log.Fatal(err) } diff --git a/docs/models/operations/applyupdatesrequest.md b/docs/models/operations/applyupdatesrequest.md index 3bf991b..c4ad949 100644 --- a/docs/models/operations/applyupdatesrequest.md +++ b/docs/models/operations/applyupdatesrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | -| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 | +| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | 1 | \ No newline at end of file diff --git a/docs/models/operations/cancelserveractivitiesrequest.md b/docs/models/operations/cancelserveractivitiesrequest.md index d4bf7ee..e306341 100644 --- a/docs/models/operations/cancelserveractivitiesrequest.md +++ b/docs/models/operations/cancelserveractivitiesrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | \ No newline at end of file diff --git a/docs/models/operations/checkforupdatesrequest.md b/docs/models/operations/checkforupdatesrequest.md index 704dfcc..9ef613c 100644 --- a/docs/models/operations/checkforupdatesrequest.md +++ b/docs/models/operations/checkforupdatesrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getstatisticsrequest.md b/docs/models/operations/getstatisticsrequest.md index 29eaf23..73aa9da 100644 --- a/docs/models/operations/getstatisticsrequest.md +++ b/docs/models/operations/getstatisticsrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/operations/gettimelinerequest.md b/docs/models/operations/gettimelinerequest.md index 400478f..b98d9b2 100644 --- a/docs/models/operations/gettimelinerequest.md +++ b/docs/models/operations/gettimelinerequest.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | -| `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | -| `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | -| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | -| `Time` | *float64* | :heavy_check_mark: | The time of the media item | -| `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | -| `Context` | *string* | :heavy_check_mark: | The context of the media item | -| `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | -| `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | -| `Row` | *float64* | :heavy_check_mark: | The row of the media item | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | 23409 | +| `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | /library/metadata/23409 | +| `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | playing | +| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 | +| `Time` | *float64* | :heavy_check_mark: | The time of the media item | 2000 | +| `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | 10000 | +| `Context` | *string* | :heavy_check_mark: | The context of the media item | home:hub.continueWatching | +| `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | 1 | +| `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | 2000 | +| `Row` | *float64* | :heavy_check_mark: | The row of the media item | 1 | \ No newline at end of file diff --git a/docs/models/operations/startuniversaltranscoderequest.md b/docs/models/operations/startuniversaltranscoderequest.md index a0bc909..30c5af9 100644 --- a/docs/models/operations/startuniversaltranscoderequest.md +++ b/docs/models/operations/startuniversaltranscoderequest.md @@ -3,21 +3,21 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | -| `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | -| `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | -| `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | -| `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | -| `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | -| `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | -| `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | -| `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | -| `Subtites` | **string* | :heavy_minus_sign: | The subtitles | -| `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | -| `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | -| `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | -| `Session` | **string* | :heavy_minus_sign: | The session ID | -| `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | -| `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 | +| `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | /library/metadata/23409 | +| `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | 0 | +| `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | 0 | +| `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | hls | +| `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | 0 | +| `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | 0 | +| `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | 0 | +| `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | 100 | +| `Subtites` | **string* | :heavy_minus_sign: | The subtitles | burn | +| `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | 100 | +| `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | lan | +| `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | 102400 | +| `Session` | **string* | :heavy_minus_sign: | The session ID | zvcage8b7rkioqcm8f4uns4c | +| `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | 0 | +| `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | 0 | \ No newline at end of file diff --git a/docs/models/operations/updateplayprogressrequest.md b/docs/models/operations/updateplayprogressrequest.md index 3dbfc3c..0ec0520 100644 --- a/docs/models/operations/updateplayprogressrequest.md +++ b/docs/models/operations/updateplayprogressrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Key` | *string* | :heavy_check_mark: | the media key | -| `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | -| `State` | *string* | :heavy_check_mark: | The playback state of the media item. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Key` | *string* | :heavy_check_mark: | the media key | | +| `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | +| `State` | *string* | :heavy_check_mark: | The playback state of the media item. | played | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 95ede55..424bf08 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -88,7 +88,7 @@ func main() { ) - var activityUUID string = "" + var activityUUID string = "25b71ed5-0f9d-461c-baa7-d404e9e10d3e" ctx := context.Background() res, err := s.Activities.CancelServerActivities(ctx, activityUUID) @@ -103,10 +103,10 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e | ### Response diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index 95b593d..d5a5edd 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -142,9 +142,9 @@ func main() { var key string = "" - var time float64 = 6900.91 + var time float64 = 90000 - var state string = "" + var state string = "played" ctx := context.Background() res, err := s.Media.UpdatePlayProgress(ctx, key, time, state) @@ -159,12 +159,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `key` | *string* | :heavy_check_mark: | the media key | -| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | -| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `key` | *string* | :heavy_check_mark: | the media key | | +| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 | +| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | played | ### Response diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 5bea03b..e6b67b6 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -33,7 +33,7 @@ func main() { ) - var timespan *int64 = plexgo.Int64(411769) + var timespan *int64 = plexgo.Int64(4) ctx := context.Background() res, err := s.Statistics.GetStatistics(ctx, timespan) @@ -48,10 +48,10 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | ### Response diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 59b014d..bd65b4c 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -100,10 +100,10 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 | ### Response @@ -141,7 +141,7 @@ func main() { var tonight *operations.Tonight = operations.TonightOne.ToPointer() - var skip *operations.Skip = operations.SkipZero.ToPointer() + var skip *operations.Skip = operations.SkipOne.ToPointer() ctx := context.Background() res, err := s.Updater.ApplyUpdates(ctx, tonight, skip) @@ -156,11 +156,11 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | -| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 | +| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | 1 | ### Response diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 34a523d..176f561 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -36,16 +36,16 @@ func main() { ctx := context.Background() res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{ - RatingKey: 716.56, - Key: "", - State: operations.StatePaused, - HasMDE: 7574.33, - Time: 3327.51, - Duration: 7585.39, - Context: "", - PlayQueueItemID: 1406.21, - PlayBackTime: 2699.34, - Row: 3536.42, + RatingKey: 23409, + Key: "/library/metadata/23409", + State: operations.StatePlaying, + HasMDE: 1, + Time: 2000, + Duration: 10000, + Context: "home:hub.continueWatching", + PlayQueueItemID: 1, + PlayBackTime: 2000, + Row: 1, }) if err != nil { log.Fatal(err) @@ -97,11 +97,22 @@ func main() { ctx := context.Background() res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ - HasMDE: 8924.99, - Path: "/etc/mail", - MediaIndex: 9962.95, - PartIndex: 1232.82, - Protocol: "", + HasMDE: 1, + Path: "/library/metadata/23409", + MediaIndex: 0, + PartIndex: 0, + Protocol: "hls", + FastSeek: plexgo.Float64(0), + DirectPlay: plexgo.Float64(0), + DirectStream: plexgo.Float64(0), + SubtitleSize: plexgo.Float64(100), + Subtites: plexgo.String("burn"), + AudioBoost: plexgo.Float64(100), + Location: plexgo.String("lan"), + MediaBufferSize: plexgo.Float64(102400), + Session: plexgo.String("zvcage8b7rkioqcm8f4uns4c"), + AddDebugOverlay: plexgo.Float64(0), + AutoAdjustQuality: plexgo.Float64(0), }) if err != nil { log.Fatal(err) diff --git a/internal/utils/json.go b/internal/utils/json.go index 3b905ca..afb6e90 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -8,6 +8,7 @@ import ( "fmt" "math/big" "reflect" + "strconv" "strings" "time" "unsafe" @@ -260,6 +261,18 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) switch typ.Kind() { + case reflect.Int64: + format := tag.Get("integer") + if format == "string" { + b := val.Interface().(int64) + return []byte(fmt.Sprintf(`"%d"`, b)), nil + } + case reflect.Float64: + format := tag.Get("number") + if format == "string" { + b := val.Interface().(float64) + return []byte(fmt.Sprintf(`"%g"`, b)), nil + } case reflect.Map: if isNil(typ, val) { return []byte("null"), nil @@ -349,6 +362,16 @@ func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.Struc if bigIntTag == "string" { return []byte(fmt.Sprintf(`"%s"`, tagValue)) } + case reflect.TypeOf(int64(0)): + format := tag.Get("integer") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(float64(0)): + format := tag.Get("number") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } case reflect.TypeOf(decimal.Big{}): decimalTag := tag.Get("decimal") if decimalTag != "number" { @@ -377,6 +400,57 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa typ := dereferenceTypePointer(v.Type()) switch typ.Kind() { + case reflect.Int64: + var b int64 + + format := tag.Get("integer") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseInt(s, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse string as int64: %w", err) + } + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } + case reflect.Float64: + var b float64 + + format := tag.Get("number") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseFloat(s, 64) + if err != nil { + return fmt.Errorf("failed to parse string as float64: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } case reflect.Map: if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { if v.CanAddr() { diff --git a/plexapi.go b/plexapi.go index 6931aa4..fbbfdd3 100644 --- a/plexapi.go +++ b/plexapi.go @@ -276,9 +276,9 @@ func New(opts ...SDKOption) *PlexAPI { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.3", - SDKVersion: "0.6.6", - GenVersion: "2.319.10", - UserAgent: "speakeasy-sdk/go 0.6.6 2.319.10 0.0.3 github.com/LukeHagar/plexgo", + SDKVersion: "0.6.7", + GenVersion: "2.322.5", + UserAgent: "speakeasy-sdk/go 0.6.7 2.322.5 0.0.3 github.com/LukeHagar/plexgo", Globals: globals.Globals{}, ServerDefaults: []map[string]string{ {