mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-08 12:37:46 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b50020e1e | ||
|
|
4bcd080211 | ||
|
|
2e0f3b64ea |
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@ generation:
|
|||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
oAuth2PasswordEnabled: false
|
oAuth2PasswordEnabled: false
|
||||||
go:
|
go:
|
||||||
version: 0.19.2
|
version: 0.20.0
|
||||||
additionalDependencies: {}
|
additionalDependencies: {}
|
||||||
allowUnknownFieldsInWeakUnions: false
|
allowUnknownFieldsInWeakUnions: false
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.513.4
|
speakeasyVersion: 1.528.1
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -9,19 +9,19 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:2066ba94b55e21d651c79003e3cf402fb77c52a0969fc52310b3383fbed038f4
|
sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
|
||||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- speakeasy-sdk-regen-1741565327
|
- speakeasy-sdk-regen-1743717350
|
||||||
targets:
|
targets:
|
||||||
plexgo:
|
plexgo:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:2066ba94b55e21d651c79003e3cf402fb77c52a0969fc52310b3383fbed038f4
|
sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
|
||||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
|
||||||
codeSamplesNamespace: code-samples-go-plexgo
|
codeSamplesNamespace: code-samples-go-plexgo
|
||||||
codeSamplesRevisionDigest: sha256:1c039b4b936c2e504fdce037068ca992efeb22b94f6fc013db92ed1923c0bc33
|
codeSamplesRevisionDigest: sha256:79894823370484c5d10a5e47db8b83467214c4416cf2ce03e19eac6a031c23b9
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
@@ -37,3 +37,5 @@ workflow:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexGO
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ targets:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexGO
|
||||||
|
|||||||
@@ -150,6 +150,10 @@ func main() {
|
|||||||
* [GetActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
|
* [GetActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
|
||||||
* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
|
* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
|
||||||
* [GetMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
|
* [GetMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
|
||||||
|
* [GetMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
|
||||||
|
* [PostMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
|
||||||
|
* [GetMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
|
||||||
|
* [PostMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
|
||||||
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||||
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||||
|
|
||||||
|
|||||||
20
RELEASES.md
20
RELEASES.md
@@ -1073,3 +1073,23 @@ Based on:
|
|||||||
- [go v0.19.2] .
|
- [go v0.19.2] .
|
||||||
### Releases
|
### Releases
|
||||||
- [Go v0.19.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.2 - .
|
- [Go v0.19.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.2 - .
|
||||||
|
|
||||||
|
## 2025-03-31 17:29:50
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.526.6 (2.563.1) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [go v0.19.3] .
|
||||||
|
### Releases
|
||||||
|
- [Go v0.19.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.19.3 - .
|
||||||
|
|
||||||
|
## 2025-04-03 21:55:33
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc
|
||||||
|
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [go v0.20.0] .
|
||||||
|
### Releases
|
||||||
|
- [Go v0.20.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.0 - .
|
||||||
276
codeSamples.yaml
276
codeSamples.yaml
@@ -7,7 +7,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getServerCapabilities
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getServerPreferences
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: updatePlayProgress
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: markPlayed
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTimeline
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: markUnplayed
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getServerActivities
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: cancelServerActivities
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: stopAllTasks
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getButlerTasks
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: startAllTasks
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: stopTask
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: startTask
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getAvailableClients
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getCompanionsData
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -456,7 +456,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getDevices
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getUserFriends
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getGeoData
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -541,7 +541,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getHomeData
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -570,7 +570,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getGlobalHubs
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-recently-added
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -633,7 +633,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: performSearch
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -662,7 +662,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: performVoiceSearch
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -691,7 +691,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getLibraryHubs
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -720,7 +720,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-server-identity
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -747,7 +747,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTopWatchedContent
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -777,7 +777,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getFileHash
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-media-meta-data
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -847,11 +847,69 @@ actions:
|
|||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"]
|
||||||
|
update:
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: go
|
||||||
|
label: PlexGO
|
||||||
|
source: |-
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.GetMediaArts(ctx, 16099)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"]
|
||||||
|
update:
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: go
|
||||||
|
label: PlexGO
|
||||||
|
source: |-
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.PostMediaArts(ctx, 2268, plexgo.String("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-banner-image
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -888,7 +946,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getMetadataChildren
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -913,11 +971,69 @@ actions:
|
|||||||
// handle response
|
// handle response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"]
|
||||||
|
update:
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: go
|
||||||
|
label: PlexGO
|
||||||
|
source: |-
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.GetMediaPosters(ctx, 16099)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"]
|
||||||
|
update:
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: go
|
||||||
|
label: PlexGO
|
||||||
|
source: |-
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.PostMediaPoster(ctx, 2268, plexgo.String("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-thumb-image
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -954,7 +1070,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-recently-added-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1002,7 +1118,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-search-all-libraries
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1038,7 +1154,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-all-libraries
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1067,7 +1183,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-watch-list
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1100,7 +1216,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: deleteLibrary
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1129,7 +1245,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-library-details
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1158,7 +1274,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-actors-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1188,7 +1304,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-all-media-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1221,7 +1337,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-countries-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1251,7 +1367,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-genres-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1281,7 +1397,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-refresh-library-metadata
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1311,7 +1427,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-search-library
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1341,7 +1457,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-library-items
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1375,7 +1491,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: logLine
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1405,7 +1521,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: logMultiLine
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1436,7 +1552,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: enablePaperTrail
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1465,7 +1581,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-media-providers
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1494,7 +1610,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getMyPlexAccount
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1523,7 +1639,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getResizedPhoto
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1561,7 +1677,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getPin
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1595,7 +1711,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTokenByPinId
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1630,7 +1746,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getPlaylists
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1659,7 +1775,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: createPlaylist
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1694,7 +1810,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: uploadPlaylist
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1724,7 +1840,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: deletePlaylist
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1753,7 +1869,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getPlaylist
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1782,7 +1898,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: updatePlaylist
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1811,7 +1927,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: clearPlaylistContents
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1840,7 +1956,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getPlaylistContents
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1870,7 +1986,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: addPlaylistContents
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1899,7 +2015,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-server-resources
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1928,7 +2044,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getSearchResults
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1957,7 +2073,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getSourceConnectionInformation
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -1986,7 +2102,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTransientToken
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2016,7 +2132,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getServerList
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2045,7 +2161,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getBandwidthStatistics
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2074,7 +2190,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getStatistics
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2103,7 +2219,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getResourcesStatistics
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2132,7 +2248,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getSessions
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2161,7 +2277,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getSessionHistory
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2191,7 +2307,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTranscodeSessions
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2220,7 +2336,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: stopTranscodeSession
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2249,7 +2365,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: applyUpdates
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2279,7 +2395,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: checkForUpdates
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2309,7 +2425,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getUpdateStatus
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2338,7 +2454,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: getTokenDetails
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2367,7 +2483,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: get-users
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2409,7 +2525,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: post-users-sign-in-data
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -2448,7 +2564,7 @@ actions:
|
|||||||
update:
|
update:
|
||||||
x-codeSamples:
|
x-codeSamples:
|
||||||
- lang: go
|
- lang: go
|
||||||
label: startUniversalTranscode
|
label: PlexGO
|
||||||
source: |-
|
source: |-
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
12
docs/models/operations/getmediaartsmediacontainer.md
Normal file
12
docs/models/operations/getmediaartsmediacontainer.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetMediaArtsMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||||
|
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||||
|
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||||
|
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||||
|
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||||
|
| `Metadata` | [][operations.GetMediaArtsMetadata](../../models/operations/getmediaartsmetadata.md) | :heavy_check_mark: | N/A | |
|
||||||
12
docs/models/operations/getmediaartsmetadata.md
Normal file
12
docs/models/operations/getmediaartsmetadata.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetMediaArtsMetadata
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||||
|
| `Provider` | **string* | :heavy_minus_sign: | The provider of the artwork. | tmdb |
|
||||||
|
| `RatingKey` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||||
|
| `Selected` | *bool* | :heavy_check_mark: | Whether this is the selected artwork. | true |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg |
|
||||||
8
docs/models/operations/getmediaartsrequest.md
Normal file
8
docs/models/operations/getmediaartsrequest.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetMediaArtsRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||||
|
| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||||
11
docs/models/operations/getmediaartsresponse.md
Normal file
11
docs/models/operations/getmediaartsresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetMediaArtsResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.GetMediaArtsResponseBody](../../models/operations/getmediaartsresponsebody.md) | :heavy_minus_sign: | The available background artwork for the library item. |
|
||||||
10
docs/models/operations/getmediaartsresponsebody.md
Normal file
10
docs/models/operations/getmediaartsresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetMediaArtsResponseBody
|
||||||
|
|
||||||
|
The available background artwork for the library item.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.GetMediaArtsMediaContainer](../../models/operations/getmediaartsmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
12
docs/models/operations/getmediapostersmediacontainer.md
Normal file
12
docs/models/operations/getmediapostersmediacontainer.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetMediaPostersMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
||||||
|
| `Size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||||
|
| `MediaTagVersion` | *int64* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||||
|
| `MediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||||
|
| `Identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||||
|
| `Metadata` | [][operations.GetMediaPostersMetadata](../../models/operations/getmediapostersmetadata.md) | :heavy_check_mark: | N/A | |
|
||||||
12
docs/models/operations/getmediapostersmetadata.md
Normal file
12
docs/models/operations/getmediapostersmetadata.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetMediaPostersMetadata
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Key` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||||
|
| `Provider` | **string* | :heavy_minus_sign: | The provider of the poster. | tmdb |
|
||||||
|
| `RatingKey` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||||
|
| `Selected` | *bool* | :heavy_check_mark: | Whether this is the selected poster. | true |
|
||||||
|
| `Thumb` | *string* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg |
|
||||||
8
docs/models/operations/getmediapostersrequest.md
Normal file
8
docs/models/operations/getmediapostersrequest.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetMediaPostersRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||||
|
| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||||
11
docs/models/operations/getmediapostersresponse.md
Normal file
11
docs/models/operations/getmediapostersresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetMediaPostersResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [*operations.GetMediaPostersResponseBody](../../models/operations/getmediapostersresponsebody.md) | :heavy_minus_sign: | The available posters for the library item. |
|
||||||
10
docs/models/operations/getmediapostersresponsebody.md
Normal file
10
docs/models/operations/getmediapostersresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetMediaPostersResponseBody
|
||||||
|
|
||||||
|
The available posters for the library item.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [*operations.GetMediaPostersMediaContainer](../../models/operations/getmediapostersmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
10
docs/models/operations/postmediaartsrequest.md
Normal file
10
docs/models/operations/postmediaartsrequest.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# PostMediaArtsRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||||
|
| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||||
|
| `URL` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||||
|
| `RequestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||||
10
docs/models/operations/postmediaartsresponse.md
Normal file
10
docs/models/operations/postmediaartsresponse.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# PostMediaArtsResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
10
docs/models/operations/postmediaposterrequest.md
Normal file
10
docs/models/operations/postmediaposterrequest.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# PostMediaPosterRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||||
|
| `RatingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||||
|
| `URL` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||||
|
| `RequestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||||
10
docs/models/operations/postmediaposterresponse.md
Normal file
10
docs/models/operations/postmediaposterresponse.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# PostMediaPosterResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
@@ -22,6 +22,10 @@ API Calls interacting with Plex Media Server Libraries
|
|||||||
* [GetActorsLibrary](#getactorslibrary) - Get Actors of library media
|
* [GetActorsLibrary](#getactorslibrary) - Get Actors of library media
|
||||||
* [GetSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
|
* [GetSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
|
||||||
* [GetMediaMetaData](#getmediametadata) - Get Media Metadata
|
* [GetMediaMetaData](#getmediametadata) - Get Media Metadata
|
||||||
|
* [GetMediaArts](#getmediaarts) - Get Media Background Artwork
|
||||||
|
* [PostMediaArts](#postmediaarts) - Upload Media Background Artwork
|
||||||
|
* [GetMediaPosters](#getmediaposters) - Get Media Posters
|
||||||
|
* [PostMediaPoster](#postmediaposter) - Upload Media Poster
|
||||||
* [GetMetadataChildren](#getmetadatachildren) - Get Items Children
|
* [GetMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||||
* [GetTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
|
* [GetTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
|
||||||
|
|
||||||
@@ -907,6 +911,210 @@ func main() {
|
|||||||
| sdkerrors.GetMediaMetaDataUnauthorized | 401 | application/json |
|
| sdkerrors.GetMediaMetaDataUnauthorized | 401 | application/json |
|
||||||
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
|
## GetMediaArts
|
||||||
|
|
||||||
|
Returns the background artwork for a library item.
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.GetMediaArts(ctx, 16099)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
|
||||||
|
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||||
|
| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||||
|
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**[*operations.GetMediaArtsResponse](../../models/operations/getmediaartsresponse.md), error**
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Type | Status Code | Content Type |
|
||||||
|
| ------------------ | ------------------ | ------------------ |
|
||||||
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
|
## PostMediaArts
|
||||||
|
|
||||||
|
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.PostMediaArts(ctx, 2268, plexgo.String("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||||
|
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||||
|
| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||||
|
| `url_` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||||
|
| `requestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||||
|
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**[*operations.PostMediaArtsResponse](../../models/operations/postmediaartsresponse.md), error**
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Type | Status Code | Content Type |
|
||||||
|
| ------------------ | ------------------ | ------------------ |
|
||||||
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
|
## GetMediaPosters
|
||||||
|
|
||||||
|
Returns the available posters for a library item.
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.GetMediaPosters(ctx, 16099)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res.Object != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
|
||||||
|
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||||
|
| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||||
|
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**[*operations.GetMediaPostersResponse](../../models/operations/getmediapostersresponse.md), error**
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Type | Status Code | Content Type |
|
||||||
|
| ------------------ | ------------------ | ------------------ |
|
||||||
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
|
## PostMediaPoster
|
||||||
|
|
||||||
|
Uploads a poster to a library item, either from a local file or a remote URL
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import(
|
||||||
|
"context"
|
||||||
|
"github.com/LukeHagar/plexgo"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
s := plexgo.New(
|
||||||
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||||
|
)
|
||||||
|
|
||||||
|
res, err := s.Library.PostMediaPoster(ctx, 2268, plexgo.String("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b"), nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if res != nil {
|
||||||
|
// handle response
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||||
|
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||||
|
| `ratingKey` | *int64* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||||
|
| `url_` | **string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||||
|
| `requestBody` | **any* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||||
|
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**[*operations.PostMediaPosterResponse](../../models/operations/postmediaposterresponse.md), error**
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Type | Status Code | Content Type |
|
||||||
|
| ------------------ | ------------------ | ------------------ |
|
||||||
|
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
|
||||||
|
|
||||||
## GetMetadataChildren
|
## GetMetadataChildren
|
||||||
|
|
||||||
This endpoint will return the children of of a library item specified with the ratingKey.
|
This endpoint will return the children of of a library item specified with the ratingKey.
|
||||||
|
|||||||
814
library.go
814
library.go
@@ -3575,6 +3575,820 @@ func (s *Library) GetMediaMetaData(ctx context.Context, request operations.GetMe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMediaArts - Get Media Background Artwork
|
||||||
|
// Returns the background artwork for a library item.
|
||||||
|
func (s *Library) GetMediaArts(ctx context.Context, ratingKey int64, opts ...operations.Option) (*operations.GetMediaArtsResponse, error) {
|
||||||
|
request := operations.GetMediaArtsRequest{
|
||||||
|
RatingKey: ratingKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/arts", request, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "get-media-arts",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
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{"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.GetMediaArtsResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
switch {
|
||||||
|
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var out operations.GetMediaArtsResponseBody
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res.Object = &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 404:
|
||||||
|
fallthrough
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostMediaArts - Upload Media Background Artwork
|
||||||
|
// Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||||
|
func (s *Library) PostMediaArts(ctx context.Context, ratingKey int64, url_ *string, requestBody *any, opts ...operations.Option) (*operations.PostMediaArtsResponse, error) {
|
||||||
|
request := operations.PostMediaArtsRequest{
|
||||||
|
RatingKey: ratingKey,
|
||||||
|
URL: url_,
|
||||||
|
RequestBody: requestBody,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/arts", request, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "post-media-arts",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "raw", `request:"mediaType=image/*"`)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "*/*")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
if reqContentType != "" {
|
||||||
|
req.Header.Set("Content-Type", reqContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||||
|
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
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{"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.PostMediaArtsResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
case httpRes.StatusCode == 404:
|
||||||
|
fallthrough
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMediaPosters - Get Media Posters
|
||||||
|
// Returns the available posters for a library item.
|
||||||
|
func (s *Library) GetMediaPosters(ctx context.Context, ratingKey int64, opts ...operations.Option) (*operations.GetMediaPostersResponse, error) {
|
||||||
|
request := operations.GetMediaPostersRequest{
|
||||||
|
RatingKey: ratingKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/posters", request, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "get-media-posters",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
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{"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.GetMediaPostersResponse{
|
||||||
|
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.GetMediaPostersResponseBody
|
||||||
|
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res.Object = &out
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
case httpRes.StatusCode == 404:
|
||||||
|
fallthrough
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostMediaPoster - Upload Media Poster
|
||||||
|
// Uploads a poster to a library item, either from a local file or a remote URL
|
||||||
|
func (s *Library) PostMediaPoster(ctx context.Context, ratingKey int64, url_ *string, requestBody *any, opts ...operations.Option) (*operations.PostMediaPosterResponse, error) {
|
||||||
|
request := operations.PostMediaPosterRequest{
|
||||||
|
RatingKey: ratingKey,
|
||||||
|
URL: url_,
|
||||||
|
RequestBody: requestBody,
|
||||||
|
}
|
||||||
|
|
||||||
|
o := operations.Options{}
|
||||||
|
supportedOptions := []string{
|
||||||
|
operations.SupportedOptionRetries,
|
||||||
|
operations.SupportedOptionTimeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(&o, supportedOptions...); err != nil {
|
||||||
|
return nil, fmt.Errorf("error applying option: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseURL string
|
||||||
|
if o.ServerURL == nil {
|
||||||
|
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||||
|
} else {
|
||||||
|
baseURL = *o.ServerURL
|
||||||
|
}
|
||||||
|
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/posters", request, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hookCtx := hooks.HookContext{
|
||||||
|
BaseURL: baseURL,
|
||||||
|
Context: ctx,
|
||||||
|
OperationID: "post-media-poster",
|
||||||
|
OAuth2Scopes: []string{},
|
||||||
|
SecuritySource: s.sdkConfiguration.Security,
|
||||||
|
}
|
||||||
|
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "raw", `request:"mediaType=image/*"`)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout := o.Timeout
|
||||||
|
if timeout == nil {
|
||||||
|
timeout = s.sdkConfiguration.Timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
if timeout != nil {
|
||||||
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(ctx, *timeout)
|
||||||
|
defer cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error creating request: %w", err)
|
||||||
|
}
|
||||||
|
req.Header.Set("Accept", "*/*")
|
||||||
|
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||||
|
if reqContentType != "" {
|
||||||
|
req.Header.Set("Content-Type", reqContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||||
|
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range o.SetHeaders {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||||
|
retryConfig := o.Retries
|
||||||
|
if retryConfig == nil {
|
||||||
|
if globalRetryConfig != nil {
|
||||||
|
retryConfig = globalRetryConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpRes *http.Response
|
||||||
|
if retryConfig != nil {
|
||||||
|
httpRes, err = utils.Retry(ctx, utils.Retries{
|
||||||
|
Config: retryConfig,
|
||||||
|
StatusCodes: []string{
|
||||||
|
"429",
|
||||||
|
"500",
|
||||||
|
"502",
|
||||||
|
"503",
|
||||||
|
"504",
|
||||||
|
},
|
||||||
|
}, func() (*http.Response, error) {
|
||||||
|
if req.Body != nil {
|
||||||
|
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{"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.PostMediaPosterResponse{
|
||||||
|
StatusCode: httpRes.StatusCode,
|
||||||
|
ContentType: httpRes.Header.Get("Content-Type"),
|
||||||
|
RawResponse: httpRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case httpRes.StatusCode == 200:
|
||||||
|
case httpRes.StatusCode == 404:
|
||||||
|
fallthrough
|
||||||
|
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
default:
|
||||||
|
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// GetMetadataChildren - Get Items Children
|
// GetMetadataChildren - Get Items Children
|
||||||
// This endpoint will return the children of of a library item specified with the ratingKey.
|
// This endpoint will return the children of of a library item specified with the ratingKey.
|
||||||
func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, includeElements *string, opts ...operations.Option) (*operations.GetMetadataChildrenResponse, error) {
|
func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, includeElements *string, opts ...operations.Option) (*operations.GetMetadataChildrenResponse, error) {
|
||||||
|
|||||||
165
models/operations/getmediaarts.go
Normal file
165
models/operations/getmediaarts.go
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
|
package operations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetMediaArtsRequest struct {
|
||||||
|
// the id of the library item to return the artwork of.
|
||||||
|
RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsRequest) GetRatingKey() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaArtsMetadata struct {
|
||||||
|
// The URL of the artwork.
|
||||||
|
Key string `json:"key"`
|
||||||
|
// The provider of the artwork.
|
||||||
|
Provider *string `json:"provider,omitempty"`
|
||||||
|
// The URL of the artwork.
|
||||||
|
RatingKey string `json:"ratingKey"`
|
||||||
|
// Whether this is the selected artwork.
|
||||||
|
Selected bool `json:"selected"`
|
||||||
|
// The URL of the artwork thumbnail.
|
||||||
|
Thumb string `json:"thumb"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMetadata) GetKey() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Key
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMetadata) GetProvider() *string {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.Provider
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMetadata) GetRatingKey() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMetadata) GetSelected() bool {
|
||||||
|
if o == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return o.Selected
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMetadata) GetThumb() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Thumb
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaArtsMediaContainer struct {
|
||||||
|
// Number of media items returned in this response.
|
||||||
|
Size int `json:"size"`
|
||||||
|
// The version number for media tags.
|
||||||
|
MediaTagVersion int64 `json:"mediaTagVersion"`
|
||||||
|
// The prefix used for media tag resource paths.
|
||||||
|
MediaTagPrefix string `json:"mediaTagPrefix"`
|
||||||
|
// An plugin identifier for the media container.
|
||||||
|
Identifier string `json:"identifier"`
|
||||||
|
Metadata []GetMediaArtsMetadata `json:"Metadata"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMediaContainer) GetSize() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMediaContainer) GetMediaTagVersion() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.MediaTagVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMediaContainer) GetMediaTagPrefix() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.MediaTagPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMediaContainer) GetIdentifier() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsMediaContainer) GetMetadata() []GetMediaArtsMetadata {
|
||||||
|
if o == nil {
|
||||||
|
return []GetMediaArtsMetadata{}
|
||||||
|
}
|
||||||
|
return o.Metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMediaArtsResponseBody - The available background artwork for the library item.
|
||||||
|
type GetMediaArtsResponseBody struct {
|
||||||
|
MediaContainer *GetMediaArtsMediaContainer `json:"MediaContainer,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsResponseBody) GetMediaContainer() *GetMediaArtsMediaContainer {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.MediaContainer
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaArtsResponse struct {
|
||||||
|
// HTTP response content type for this operation
|
||||||
|
ContentType string
|
||||||
|
// HTTP response status code for this operation
|
||||||
|
StatusCode int
|
||||||
|
// Raw HTTP response; suitable for custom response parsing
|
||||||
|
RawResponse *http.Response
|
||||||
|
// The available background artwork for the library item.
|
||||||
|
Object *GetMediaArtsResponseBody
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsResponse) GetContentType() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.ContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsResponse) GetStatusCode() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.StatusCode
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsResponse) GetRawResponse() *http.Response {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RawResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaArtsResponse) GetObject() *GetMediaArtsResponseBody {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.Object
|
||||||
|
}
|
||||||
165
models/operations/getmediaposters.go
Normal file
165
models/operations/getmediaposters.go
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
|
package operations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetMediaPostersRequest struct {
|
||||||
|
// the id of the library item to return the posters of.
|
||||||
|
RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersRequest) GetRatingKey() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaPostersMetadata struct {
|
||||||
|
// The URL of the poster.
|
||||||
|
Key string `json:"key"`
|
||||||
|
// The provider of the poster.
|
||||||
|
Provider *string `json:"provider,omitempty"`
|
||||||
|
// The URL of the poster.
|
||||||
|
RatingKey string `json:"ratingKey"`
|
||||||
|
// Whether this is the selected poster.
|
||||||
|
Selected bool `json:"selected"`
|
||||||
|
// The URL of the poster thumbnail.
|
||||||
|
Thumb string `json:"thumb"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMetadata) GetKey() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Key
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMetadata) GetProvider() *string {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.Provider
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMetadata) GetRatingKey() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMetadata) GetSelected() bool {
|
||||||
|
if o == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return o.Selected
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMetadata) GetThumb() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Thumb
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaPostersMediaContainer struct {
|
||||||
|
// Number of media items returned in this response.
|
||||||
|
Size int `json:"size"`
|
||||||
|
// The version number for media tags.
|
||||||
|
MediaTagVersion int64 `json:"mediaTagVersion"`
|
||||||
|
// The prefix used for media tag resource paths.
|
||||||
|
MediaTagPrefix string `json:"mediaTagPrefix"`
|
||||||
|
// An plugin identifier for the media container.
|
||||||
|
Identifier string `json:"identifier"`
|
||||||
|
Metadata []GetMediaPostersMetadata `json:"Metadata"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMediaContainer) GetSize() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMediaContainer) GetMediaTagVersion() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.MediaTagVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMediaContainer) GetMediaTagPrefix() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.MediaTagPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMediaContainer) GetIdentifier() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.Identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersMediaContainer) GetMetadata() []GetMediaPostersMetadata {
|
||||||
|
if o == nil {
|
||||||
|
return []GetMediaPostersMetadata{}
|
||||||
|
}
|
||||||
|
return o.Metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMediaPostersResponseBody - The available posters for the library item.
|
||||||
|
type GetMediaPostersResponseBody struct {
|
||||||
|
MediaContainer *GetMediaPostersMediaContainer `json:"MediaContainer,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersResponseBody) GetMediaContainer() *GetMediaPostersMediaContainer {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.MediaContainer
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetMediaPostersResponse struct {
|
||||||
|
// HTTP response content type for this operation
|
||||||
|
ContentType string
|
||||||
|
// HTTP response status code for this operation
|
||||||
|
StatusCode int
|
||||||
|
// Raw HTTP response; suitable for custom response parsing
|
||||||
|
RawResponse *http.Response
|
||||||
|
// The available posters for the library item.
|
||||||
|
Object *GetMediaPostersResponseBody
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersResponse) GetContentType() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.ContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersResponse) GetStatusCode() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.StatusCode
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersResponse) GetRawResponse() *http.Response {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RawResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetMediaPostersResponse) GetObject() *GetMediaPostersResponseBody {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.Object
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ type AcceptHeaderEnum string
|
|||||||
const (
|
const (
|
||||||
AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json"
|
AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json"
|
||||||
AcceptHeaderEnumImageJpeg AcceptHeaderEnum = "image/jpeg"
|
AcceptHeaderEnumImageJpeg AcceptHeaderEnum = "image/jpeg"
|
||||||
|
AcceptHeaderEnumWildcardRootWildcard AcceptHeaderEnum = "*/*"
|
||||||
AcceptHeaderEnumApplicationXml AcceptHeaderEnum = "application/xml"
|
AcceptHeaderEnumApplicationXml AcceptHeaderEnum = "application/xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
68
models/operations/postmediaarts.go
Normal file
68
models/operations/postmediaarts.go
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
|
package operations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PostMediaArtsRequest struct {
|
||||||
|
// the id of the library item to return the posters of.
|
||||||
|
RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"`
|
||||||
|
// The URL of the image, if uploading a remote image
|
||||||
|
URL *string `queryParam:"style=form,explode=true,name=url"`
|
||||||
|
// The contents of the image, if uploading a local file
|
||||||
|
// This field accepts []byte data or io.Reader implementations, such as *os.File.
|
||||||
|
RequestBody *any `request:"mediaType=image/*"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsRequest) GetRatingKey() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsRequest) GetURL() *string {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.URL
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsRequest) GetRequestBody() *any {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RequestBody
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostMediaArtsResponse struct {
|
||||||
|
// HTTP response content type for this operation
|
||||||
|
ContentType string
|
||||||
|
// HTTP response status code for this operation
|
||||||
|
StatusCode int
|
||||||
|
// Raw HTTP response; suitable for custom response parsing
|
||||||
|
RawResponse *http.Response
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsResponse) GetContentType() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.ContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsResponse) GetStatusCode() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.StatusCode
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaArtsResponse) GetRawResponse() *http.Response {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RawResponse
|
||||||
|
}
|
||||||
68
models/operations/postmediaposter.go
Normal file
68
models/operations/postmediaposter.go
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||||
|
|
||||||
|
package operations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PostMediaPosterRequest struct {
|
||||||
|
// the id of the library item to return the posters of.
|
||||||
|
RatingKey int64 `pathParam:"style=simple,explode=false,name=ratingKey"`
|
||||||
|
// The URL of the image, if uploading a remote image
|
||||||
|
URL *string `queryParam:"style=form,explode=true,name=url"`
|
||||||
|
// The contents of the image, if uploading a local file
|
||||||
|
// This field accepts []byte data or io.Reader implementations, such as *os.File.
|
||||||
|
RequestBody *any `request:"mediaType=image/*"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterRequest) GetRatingKey() int64 {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.RatingKey
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterRequest) GetURL() *string {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.URL
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterRequest) GetRequestBody() *any {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RequestBody
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostMediaPosterResponse struct {
|
||||||
|
// HTTP response content type for this operation
|
||||||
|
ContentType string
|
||||||
|
// HTTP response status code for this operation
|
||||||
|
StatusCode int
|
||||||
|
// Raw HTTP response; suitable for custom response parsing
|
||||||
|
RawResponse *http.Response
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterResponse) GetContentType() string {
|
||||||
|
if o == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return o.ContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterResponse) GetStatusCode() int {
|
||||||
|
if o == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return o.StatusCode
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostMediaPosterResponse) GetRawResponse() *http.Response {
|
||||||
|
if o == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return o.RawResponse
|
||||||
|
}
|
||||||
@@ -299,9 +299,9 @@ func New(opts ...SDKOption) *PlexAPI {
|
|||||||
sdkConfiguration: sdkConfiguration{
|
sdkConfiguration: sdkConfiguration{
|
||||||
Language: "go",
|
Language: "go",
|
||||||
OpenAPIDocVersion: "0.0.3",
|
OpenAPIDocVersion: "0.0.3",
|
||||||
SDKVersion: "0.19.2",
|
SDKVersion: "0.20.0",
|
||||||
GenVersion: "2.545.4",
|
GenVersion: "2.565.1",
|
||||||
UserAgent: "speakeasy-sdk/go 0.19.2 2.545.4 0.0.3 github.com/LukeHagar/plexgo",
|
UserAgent: "speakeasy-sdk/go 0.20.0 2.565.1 0.0.3 github.com/LukeHagar/plexgo",
|
||||||
ServerDefaults: []map[string]string{
|
ServerDefaults: []map[string]string{
|
||||||
{
|
{
|
||||||
"protocol": "https",
|
"protocol": "https",
|
||||||
|
|||||||
Reference in New Issue
Block a user