mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.0
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.speakeasy/reports
|
||||
# .gitignore
|
||||
|
||||
1444
.speakeasy/gen.lock
1444
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ generation:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
go:
|
||||
version: 0.17.1
|
||||
version: 0.17.2
|
||||
additionalDependencies: {}
|
||||
allowUnknownFieldsInWeakUnions: false
|
||||
clientServerStatusCodesAsErrors: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.459.2
|
||||
speakeasyVersion: 1.476.0
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -9,19 +9,19 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:28e2213b78ff9c789846a4a0b7ab9fb219079a1699d44b22d28474efc4f48eac
|
||||
sourceBlobDigest: sha256:fa76c39de0ff801844dd56a76c26ab6ca88695fc9b42bb9ff9a8aab5b2b21277
|
||||
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
|
||||
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1734912576
|
||||
- speakeasy-sdk-regen-1737763744
|
||||
targets:
|
||||
plexgo:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:28e2213b78ff9c789846a4a0b7ab9fb219079a1699d44b22d28474efc4f48eac
|
||||
sourceBlobDigest: sha256:fa76c39de0ff801844dd56a76c26ab6ca88695fc9b42bb9ff9a8aab5b2b21277
|
||||
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
|
||||
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
|
||||
codeSamplesNamespace: code-samples-go-plexgo
|
||||
codeSamplesRevisionDigest: sha256:b5730b78047905ab5c8d646eef73df09888a3dcb4553fed2b6daa50fdd605891
|
||||
codeSamplesRevisionDigest: sha256:a9b4a5597cc8dc7e97e7ce3e68de850538878f6a879c0b400ae0d4757f7f8743
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
10
RELEASES.md
10
RELEASES.md
@@ -993,3 +993,13 @@ Based on:
|
||||
- [go v0.17.1] .
|
||||
### Releases
|
||||
- [Go v0.17.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.1 - .
|
||||
|
||||
## 2025-01-25 00:08:47
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.476.0 (2.496.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [go v0.17.2] .
|
||||
### Releases
|
||||
- [Go v0.17.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.17.2 - .
|
||||
@@ -253,7 +253,11 @@ func (s *Activities) GetServerActivities(ctx context.Context, opts ...operations
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -477,7 +481,11 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -236,7 +236,11 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -465,7 +469,11 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -704,7 +712,11 @@ func (s *Authentication) GetTokenDetails(ctx context.Context, opts ...operations
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -777,7 +789,9 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request operat
|
||||
}
|
||||
req.Header.Set("Accept", "application/json")
|
||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
if reqContentType != "" {
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
}
|
||||
|
||||
utils.PopulateHeaders(ctx, req, request, nil)
|
||||
|
||||
@@ -947,7 +961,11 @@ func (s *Authentication) PostUsersSignInData(ctx context.Context, request operat
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
30
butler.go
30
butler.go
@@ -247,7 +247,11 @@ func (s *Butler) GetButlerTasks(ctx context.Context, opts ...operations.Option)
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -471,7 +475,11 @@ func (s *Butler) StartAllTasks(ctx context.Context, opts ...operations.Option) (
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -691,7 +699,11 @@ func (s *Butler) StopAllTasks(ctx context.Context, opts ...operations.Option) (*
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -921,7 +933,11 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName, op
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1147,7 +1163,11 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
|
||||
case httpRes.StatusCode == 404:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -182,7 +182,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: getMetadataChildren
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetMetadataChildren(ctx, 1539.15, plexgo.String(\"Stream\"))\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetMetadataChildren(ctx, 1539.14, plexgo.String(\"Stream\"))\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -230,7 +230,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: details
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer())\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -290,7 +290,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: getPin
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.AuthPinContainer != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{\n Strong: plexgo.Bool(false),\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.AuthPinContainer != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/pins/{pinID}"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -332,7 +332,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: updatePlaylist
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Playlists.UpdatePlaylist(ctx, 3915.00, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Playlists.UpdatePlaylist(ctx, 3915, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -350,7 +350,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: addPlaylistContents
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Playlists.AddPlaylistContents(ctx, 8502.00, \"server://12345/com.plexapp.plugins.library/library/metadata/1\", plexgo.Float64(123))\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n )\n\n res, err := s.Playlists.AddPlaylistContents(ctx, 8502.01, \"server://12345/com.plexapp.plugins.library/library/metadata/1\", plexgo.Float64(123))\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/resources"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -452,7 +452,7 @@ actions:
|
||||
x-codeSamples:
|
||||
- lang: go
|
||||
label: data
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n RequestBody: &operations.PostUsersSignInDataRequestBody{\n Login: \"username@email.com\",\n Password: \"password123\",\n VerificationCode: plexgo.String(\"123456\"),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UserPlexAccount != nil {\n // handle response\n }\n}"
|
||||
source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := plexgo.New()\n\n res, err := s.Authentication.PostUsersSignInData(ctx, operations.PostUsersSignInDataRequest{\n ClientID: \"3381b62b-9ab7-4e37-827b-203e9809eb58\",\n ClientName: plexgo.String(\"Plex for Roku\"),\n DeviceNickname: plexgo.String(\"Roku 3\"),\n ClientVersion: plexgo.String(\"2.4.1\"),\n Platform: plexgo.String(\"Roku\"),\n RequestBody: &operations.PostUsersSignInDataRequestBody{\n Login: \"username@email.com\",\n Password: \"password123\",\n RememberMe: plexgo.Bool(false),\n VerificationCode: plexgo.String(\"123456\"),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UserPlexAccount != nil {\n // handle response\n }\n}"
|
||||
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
|
||||
11
docs/models/operations/enablecreditsmarkergeneration.md
Normal file
11
docs/models/operations/enablecreditsmarkergeneration.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# EnableCreditsMarkerGeneration
|
||||
|
||||
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| `EnableCreditsMarkerGenerationLibraryDefault` | -1 |
|
||||
| `EnableCreditsMarkerGenerationDisabled` | 0 |
|
||||
12
docs/models/operations/episodesort.md
Normal file
12
docs/models/operations/episodesort.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# EpisodeSort
|
||||
|
||||
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `EpisodeSortLibraryDefault` | -1 |
|
||||
| `EpisodeSortOldestFirst` | 0 |
|
||||
| `EpisodeSortNewestFirst` | 1 |
|
||||
@@ -1,9 +1,12 @@
|
||||
# FlattenSeasons
|
||||
|
||||
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------------- | --------------------- |
|
||||
| `FlattenSeasonsFalse` | 0 |
|
||||
| `FlattenSeasonsTrue` | 1 |
|
||||
| Name | Value |
|
||||
| ------------------------------ | ------------------------------ |
|
||||
| `FlattenSeasonsLibraryDefault` | -1 |
|
||||
| `FlattenSeasonsHide` | 0 |
|
||||
| `FlattenSeasonsShow` | 1 |
|
||||
@@ -0,0 +1,11 @@
|
||||
# GetLibraryItemsEnableCreditsMarkerGeneration
|
||||
|
||||
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `GetLibraryItemsEnableCreditsMarkerGenerationLibraryDefault` | -1 |
|
||||
| `GetLibraryItemsEnableCreditsMarkerGenerationDisabled` | 0 |
|
||||
12
docs/models/operations/getlibraryitemsepisodesort.md
Normal file
12
docs/models/operations/getlibraryitemsepisodesort.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetLibraryItemsEpisodeSort
|
||||
|
||||
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------ | ------------------------------------------ |
|
||||
| `GetLibraryItemsEpisodeSortLibraryDefault` | -1 |
|
||||
| `GetLibraryItemsEpisodeSortOldestFirst` | 0 |
|
||||
| `GetLibraryItemsEpisodeSortNewestFirst` | 1 |
|
||||
@@ -1,9 +1,12 @@
|
||||
# GetLibraryItemsFlattenSeasons
|
||||
|
||||
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------ | ------------------------------------ |
|
||||
| `GetLibraryItemsFlattenSeasonsFalse` | 0 |
|
||||
| `GetLibraryItemsFlattenSeasonsTrue` | 1 |
|
||||
| Name | Value |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| `GetLibraryItemsFlattenSeasonsLibraryDefault` | -1 |
|
||||
| `GetLibraryItemsFlattenSeasonsHide` | 0 |
|
||||
| `GetLibraryItemsFlattenSeasonsShow` | 1 |
|
||||
@@ -23,7 +23,9 @@
|
||||
| `Year` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `SeasonCount` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
|
||||
| `FlattenSeasons` | [*operations.GetLibraryItemsFlattenSeasons](../../models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `FlattenSeasons` | [*operations.GetLibraryItemsFlattenSeasons](../../models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
|
||||
| `EpisodeSort` | [*operations.GetLibraryItemsEpisodeSort](../../models/operations/getlibraryitemsepisodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
|
||||
| `EnableCreditsMarkerGeneration` | [*operations.GetLibraryItemsEnableCreditsMarkerGeneration](../../models/operations/getlibraryitemsenablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
|
||||
| `ShowOrdering` | [*operations.GetLibraryItemsShowOrdering](../../models/operations/getlibraryitemsshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
|
||||
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
|
||||
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
| `Year` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `SeasonCount` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
|
||||
| `FlattenSeasons` | [*operations.FlattenSeasons](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `FlattenSeasons` | [*operations.FlattenSeasons](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
|
||||
| `EpisodeSort` | [*operations.EpisodeSort](../../models/operations/episodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
|
||||
| `EnableCreditsMarkerGeneration` | [*operations.EnableCreditsMarkerGeneration](../../models/operations/enablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
|
||||
| `ShowOrdering` | [*operations.ShowOrdering](../../models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
|
||||
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
|
||||
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# GetSearchAllLibrariesEnableCreditsMarkerGeneration
|
||||
|
||||
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `GetSearchAllLibrariesEnableCreditsMarkerGenerationLibraryDefault` | -1 |
|
||||
| `GetSearchAllLibrariesEnableCreditsMarkerGenerationDisabled` | 0 |
|
||||
12
docs/models/operations/getsearchalllibrariesepisodesort.md
Normal file
12
docs/models/operations/getsearchalllibrariesepisodesort.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetSearchAllLibrariesEpisodeSort
|
||||
|
||||
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `GetSearchAllLibrariesEpisodeSortLibraryDefault` | -1 |
|
||||
| `GetSearchAllLibrariesEpisodeSortOldestFirst` | 0 |
|
||||
| `GetSearchAllLibrariesEpisodeSortNewestFirst` | 1 |
|
||||
@@ -1,9 +1,12 @@
|
||||
# GetSearchAllLibrariesFlattenSeasons
|
||||
|
||||
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------------------------------ | ------------------------------------------ |
|
||||
| `GetSearchAllLibrariesFlattenSeasonsFalse` | 0 |
|
||||
| `GetSearchAllLibrariesFlattenSeasonsTrue` | 1 |
|
||||
| Name | Value |
|
||||
| --------------------------------------------------- | --------------------------------------------------- |
|
||||
| `GetSearchAllLibrariesFlattenSeasonsLibraryDefault` | -1 |
|
||||
| `GetSearchAllLibrariesFlattenSeasonsHide` | 0 |
|
||||
| `GetSearchAllLibrariesFlattenSeasonsShow` | 1 |
|
||||
@@ -23,7 +23,9 @@
|
||||
| `Year` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `SeasonCount` | **int* | :heavy_minus_sign: | N/A | 2022 |
|
||||
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
|
||||
| `FlattenSeasons` | [*operations.GetSearchAllLibrariesFlattenSeasons](../../models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
|
||||
| `FlattenSeasons` | [*operations.GetSearchAllLibrariesFlattenSeasons](../../models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
|
||||
| `EpisodeSort` | [*operations.GetSearchAllLibrariesEpisodeSort](../../models/operations/getsearchalllibrariesepisodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
|
||||
| `EnableCreditsMarkerGeneration` | [*operations.GetSearchAllLibrariesEnableCreditsMarkerGeneration](../../models/operations/getsearchalllibrariesenablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
|
||||
| `ShowOrdering` | [*operations.GetSearchAllLibrariesShowOrdering](../../models/operations/getsearchalllibrariesshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
|
||||
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
|
||||
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
|
||||
|
||||
@@ -203,6 +203,7 @@ func main() {
|
||||
RequestBody: &operations.PostUsersSignInDataRequestBody{
|
||||
Login: "username@email.com",
|
||||
Password: "password123",
|
||||
RememberMe: plexgo.Bool(false),
|
||||
VerificationCode: plexgo.String("123456"),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -258,6 +258,7 @@ package main
|
||||
import(
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"log"
|
||||
)
|
||||
|
||||
@@ -268,7 +269,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)
|
||||
res, err := s.Library.GetLibraryDetails(ctx, 9518, operations.IncludeDetailsZero.ToPointer())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func main() {
|
||||
Title: "<value>",
|
||||
Type: operations.CreatePlaylistQueryParamTypePhoto,
|
||||
Smart: operations.SmartOne,
|
||||
URI: "https://inborn-brochure.biz",
|
||||
URI: "https://hoarse-testing.info/",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -296,6 +296,7 @@ func main() {
|
||||
s := plexgo.New()
|
||||
|
||||
res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{
|
||||
Strong: plexgo.Bool(false),
|
||||
ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
ClientName: plexgo.String("Plex for Roku"),
|
||||
DeviceNickname: plexgo.String("Roku 3"),
|
||||
|
||||
@@ -351,7 +351,7 @@ func main() {
|
||||
Opacity: 100,
|
||||
Blur: 0,
|
||||
MinSize: operations.MinSizeOne,
|
||||
Upscale: operations.UpscaleZero,
|
||||
Upscale: operations.UpscaleOne,
|
||||
URL: "/library/metadata/49564/thumb/1654258204",
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
18
hubs.go
18
hubs.go
@@ -256,7 +256,11 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -460,7 +464,11 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen
|
||||
case httpRes.StatusCode == 401:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -710,7 +718,11 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
78
library.go
78
library.go
@@ -236,7 +236,11 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64,
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -480,7 +484,11 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -725,7 +733,11 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1012,7 +1024,11 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1236,7 +1252,11 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1500,7 +1520,11 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1729,7 +1753,11 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int,
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1995,7 +2023,11 @@ func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ op
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2241,7 +2273,11 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2485,7 +2521,11 @@ func (s *Library) GetMetaDataByRatingKey(ctx context.Context, ratingKey int64, o
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2734,7 +2774,11 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2983,7 +3027,11 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -3223,7 +3271,11 @@ func (s *Library) GetOnDeck(ctx context.Context, opts ...operations.Option) (*op
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
22
log.go
22
log.go
@@ -237,7 +237,11 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -331,7 +335,9 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio
|
||||
}
|
||||
req.Header.Set("Accept", "application/json")
|
||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
if reqContentType != "" {
|
||||
req.Header.Set("Content-Type", reqContentType)
|
||||
}
|
||||
|
||||
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
|
||||
return nil, err
|
||||
@@ -483,7 +489,11 @@ func (s *Log) LogMultiLine(ctx context.Context, request string, opts ...operatio
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -705,7 +715,11 @@ func (s *Log) EnablePaperTrail(ctx context.Context, opts ...operations.Option) (
|
||||
case httpRes.StatusCode == 403:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
30
media.go
30
media.go
@@ -235,7 +235,11 @@ func (s *Media) MarkPlayed(ctx context.Context, key float64, opts ...operations.
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -463,7 +467,11 @@ func (s *Media) MarkUnplayed(ctx context.Context, key float64, opts ...operation
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -693,7 +701,11 @@ func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -933,7 +945,11 @@ func (s *Media) GetBannerImage(ctx context.Context, request operations.GetBanner
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1173,7 +1189,11 @@ func (s *Media) GetThumbImage(ctx context.Context, request operations.GetThumbIm
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -629,11 +629,13 @@ func (e *GetLibraryItemsLibraryType) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// GetLibraryItemsFlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
type GetLibraryItemsFlattenSeasons string
|
||||
|
||||
const (
|
||||
GetLibraryItemsFlattenSeasonsFalse GetLibraryItemsFlattenSeasons = "0"
|
||||
GetLibraryItemsFlattenSeasonsTrue GetLibraryItemsFlattenSeasons = "1"
|
||||
GetLibraryItemsFlattenSeasonsLibraryDefault GetLibraryItemsFlattenSeasons = "-1"
|
||||
GetLibraryItemsFlattenSeasonsHide GetLibraryItemsFlattenSeasons = "0"
|
||||
GetLibraryItemsFlattenSeasonsShow GetLibraryItemsFlattenSeasons = "1"
|
||||
)
|
||||
|
||||
func (e GetLibraryItemsFlattenSeasons) ToPointer() *GetLibraryItemsFlattenSeasons {
|
||||
@@ -645,6 +647,8 @@ func (e *GetLibraryItemsFlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
@@ -655,6 +659,63 @@ func (e *GetLibraryItemsFlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// GetLibraryItemsEpisodeSort - Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
type GetLibraryItemsEpisodeSort string
|
||||
|
||||
const (
|
||||
GetLibraryItemsEpisodeSortLibraryDefault GetLibraryItemsEpisodeSort = "-1"
|
||||
GetLibraryItemsEpisodeSortOldestFirst GetLibraryItemsEpisodeSort = "0"
|
||||
GetLibraryItemsEpisodeSortNewestFirst GetLibraryItemsEpisodeSort = "1"
|
||||
)
|
||||
|
||||
func (e GetLibraryItemsEpisodeSort) ToPointer() *GetLibraryItemsEpisodeSort {
|
||||
return &e
|
||||
}
|
||||
func (e *GetLibraryItemsEpisodeSort) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
*e = GetLibraryItemsEpisodeSort(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for GetLibraryItemsEpisodeSort: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// GetLibraryItemsEnableCreditsMarkerGeneration - Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
type GetLibraryItemsEnableCreditsMarkerGeneration string
|
||||
|
||||
const (
|
||||
GetLibraryItemsEnableCreditsMarkerGenerationLibraryDefault GetLibraryItemsEnableCreditsMarkerGeneration = "-1"
|
||||
GetLibraryItemsEnableCreditsMarkerGenerationDisabled GetLibraryItemsEnableCreditsMarkerGeneration = "0"
|
||||
)
|
||||
|
||||
func (e GetLibraryItemsEnableCreditsMarkerGeneration) ToPointer() *GetLibraryItemsEnableCreditsMarkerGeneration {
|
||||
return &e
|
||||
}
|
||||
func (e *GetLibraryItemsEnableCreditsMarkerGeneration) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
*e = GetLibraryItemsEnableCreditsMarkerGeneration(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for GetLibraryItemsEnableCreditsMarkerGeneration: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// GetLibraryItemsShowOrdering - Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1642,17 +1703,22 @@ type GetLibraryItemsMetadata struct {
|
||||
LibrarySectionKey *string `json:"librarySectionKey,omitempty"`
|
||||
// The type of media content
|
||||
//
|
||||
Type GetLibraryItemsLibraryType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Slug *string `json:"slug,omitempty"`
|
||||
ContentRating *string `json:"contentRating,omitempty"`
|
||||
Summary string `json:"summary"`
|
||||
Rating *float64 `json:"rating,omitempty"`
|
||||
AudienceRating *float64 `json:"audienceRating,omitempty"`
|
||||
Year *int `json:"year,omitempty"`
|
||||
SeasonCount *int `json:"seasonCount,omitempty"`
|
||||
Tagline *string `json:"tagline,omitempty"`
|
||||
FlattenSeasons *GetLibraryItemsFlattenSeasons `default:"0" json:"flattenSeasons"`
|
||||
Type GetLibraryItemsLibraryType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Slug *string `json:"slug,omitempty"`
|
||||
ContentRating *string `json:"contentRating,omitempty"`
|
||||
Summary string `json:"summary"`
|
||||
Rating *float64 `json:"rating,omitempty"`
|
||||
AudienceRating *float64 `json:"audienceRating,omitempty"`
|
||||
Year *int `json:"year,omitempty"`
|
||||
SeasonCount *int `json:"seasonCount,omitempty"`
|
||||
Tagline *string `json:"tagline,omitempty"`
|
||||
// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
FlattenSeasons *GetLibraryItemsFlattenSeasons `json:"flattenSeasons,omitempty"`
|
||||
// Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
EpisodeSort *GetLibraryItemsEpisodeSort `json:"episodeSort,omitempty"`
|
||||
// Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
EnableCreditsMarkerGeneration *GetLibraryItemsEnableCreditsMarkerGeneration `json:"enableCreditsMarkerGeneration,omitempty"`
|
||||
// Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1869,6 +1935,20 @@ func (o *GetLibraryItemsMetadata) GetFlattenSeasons() *GetLibraryItemsFlattenSea
|
||||
return o.FlattenSeasons
|
||||
}
|
||||
|
||||
func (o *GetLibraryItemsMetadata) GetEpisodeSort() *GetLibraryItemsEpisodeSort {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EpisodeSort
|
||||
}
|
||||
|
||||
func (o *GetLibraryItemsMetadata) GetEnableCreditsMarkerGeneration() *GetLibraryItemsEnableCreditsMarkerGeneration {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EnableCreditsMarkerGeneration
|
||||
}
|
||||
|
||||
func (o *GetLibraryItemsMetadata) GetShowOrdering() *GetLibraryItemsShowOrdering {
|
||||
if o == nil {
|
||||
return nil
|
||||
|
||||
@@ -538,11 +538,13 @@ func (e *GetRecentlyAddedHubsType) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// FlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
type FlattenSeasons string
|
||||
|
||||
const (
|
||||
FlattenSeasonsFalse FlattenSeasons = "0"
|
||||
FlattenSeasonsTrue FlattenSeasons = "1"
|
||||
FlattenSeasonsLibraryDefault FlattenSeasons = "-1"
|
||||
FlattenSeasonsHide FlattenSeasons = "0"
|
||||
FlattenSeasonsShow FlattenSeasons = "1"
|
||||
)
|
||||
|
||||
func (e FlattenSeasons) ToPointer() *FlattenSeasons {
|
||||
@@ -554,6 +556,8 @@ func (e *FlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
@@ -564,6 +568,63 @@ func (e *FlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// EpisodeSort - Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
type EpisodeSort string
|
||||
|
||||
const (
|
||||
EpisodeSortLibraryDefault EpisodeSort = "-1"
|
||||
EpisodeSortOldestFirst EpisodeSort = "0"
|
||||
EpisodeSortNewestFirst EpisodeSort = "1"
|
||||
)
|
||||
|
||||
func (e EpisodeSort) ToPointer() *EpisodeSort {
|
||||
return &e
|
||||
}
|
||||
func (e *EpisodeSort) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
*e = EpisodeSort(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for EpisodeSort: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// EnableCreditsMarkerGeneration - Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
type EnableCreditsMarkerGeneration string
|
||||
|
||||
const (
|
||||
EnableCreditsMarkerGenerationLibraryDefault EnableCreditsMarkerGeneration = "-1"
|
||||
EnableCreditsMarkerGenerationDisabled EnableCreditsMarkerGeneration = "0"
|
||||
)
|
||||
|
||||
func (e EnableCreditsMarkerGeneration) ToPointer() *EnableCreditsMarkerGeneration {
|
||||
return &e
|
||||
}
|
||||
func (e *EnableCreditsMarkerGeneration) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
*e = EnableCreditsMarkerGeneration(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for EnableCreditsMarkerGeneration: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// ShowOrdering - Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1561,7 +1622,12 @@ type GetRecentlyAddedMetadata struct {
|
||||
Year *int `json:"year,omitempty"`
|
||||
SeasonCount *int `json:"seasonCount,omitempty"`
|
||||
Tagline *string `json:"tagline,omitempty"`
|
||||
FlattenSeasons *FlattenSeasons `default:"0" json:"flattenSeasons"`
|
||||
// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
FlattenSeasons *FlattenSeasons `json:"flattenSeasons,omitempty"`
|
||||
// Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
EpisodeSort *EpisodeSort `json:"episodeSort,omitempty"`
|
||||
// Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
EnableCreditsMarkerGeneration *EnableCreditsMarkerGeneration `json:"enableCreditsMarkerGeneration,omitempty"`
|
||||
// Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1778,6 +1844,20 @@ func (o *GetRecentlyAddedMetadata) GetFlattenSeasons() *FlattenSeasons {
|
||||
return o.FlattenSeasons
|
||||
}
|
||||
|
||||
func (o *GetRecentlyAddedMetadata) GetEpisodeSort() *EpisodeSort {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EpisodeSort
|
||||
}
|
||||
|
||||
func (o *GetRecentlyAddedMetadata) GetEnableCreditsMarkerGeneration() *EnableCreditsMarkerGeneration {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EnableCreditsMarkerGeneration
|
||||
}
|
||||
|
||||
func (o *GetRecentlyAddedMetadata) GetShowOrdering() *ShowOrdering {
|
||||
if o == nil {
|
||||
return nil
|
||||
|
||||
@@ -201,11 +201,13 @@ func (e *GetSearchAllLibrariesType) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// GetSearchAllLibrariesFlattenSeasons - Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
type GetSearchAllLibrariesFlattenSeasons string
|
||||
|
||||
const (
|
||||
GetSearchAllLibrariesFlattenSeasonsFalse GetSearchAllLibrariesFlattenSeasons = "0"
|
||||
GetSearchAllLibrariesFlattenSeasonsTrue GetSearchAllLibrariesFlattenSeasons = "1"
|
||||
GetSearchAllLibrariesFlattenSeasonsLibraryDefault GetSearchAllLibrariesFlattenSeasons = "-1"
|
||||
GetSearchAllLibrariesFlattenSeasonsHide GetSearchAllLibrariesFlattenSeasons = "0"
|
||||
GetSearchAllLibrariesFlattenSeasonsShow GetSearchAllLibrariesFlattenSeasons = "1"
|
||||
)
|
||||
|
||||
func (e GetSearchAllLibrariesFlattenSeasons) ToPointer() *GetSearchAllLibrariesFlattenSeasons {
|
||||
@@ -217,6 +219,8 @@ func (e *GetSearchAllLibrariesFlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
@@ -227,6 +231,63 @@ func (e *GetSearchAllLibrariesFlattenSeasons) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
// GetSearchAllLibrariesEpisodeSort - Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
type GetSearchAllLibrariesEpisodeSort string
|
||||
|
||||
const (
|
||||
GetSearchAllLibrariesEpisodeSortLibraryDefault GetSearchAllLibrariesEpisodeSort = "-1"
|
||||
GetSearchAllLibrariesEpisodeSortOldestFirst GetSearchAllLibrariesEpisodeSort = "0"
|
||||
GetSearchAllLibrariesEpisodeSortNewestFirst GetSearchAllLibrariesEpisodeSort = "1"
|
||||
)
|
||||
|
||||
func (e GetSearchAllLibrariesEpisodeSort) ToPointer() *GetSearchAllLibrariesEpisodeSort {
|
||||
return &e
|
||||
}
|
||||
func (e *GetSearchAllLibrariesEpisodeSort) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
fallthrough
|
||||
case "1":
|
||||
*e = GetSearchAllLibrariesEpisodeSort(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for GetSearchAllLibrariesEpisodeSort: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// GetSearchAllLibrariesEnableCreditsMarkerGeneration - Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
type GetSearchAllLibrariesEnableCreditsMarkerGeneration string
|
||||
|
||||
const (
|
||||
GetSearchAllLibrariesEnableCreditsMarkerGenerationLibraryDefault GetSearchAllLibrariesEnableCreditsMarkerGeneration = "-1"
|
||||
GetSearchAllLibrariesEnableCreditsMarkerGenerationDisabled GetSearchAllLibrariesEnableCreditsMarkerGeneration = "0"
|
||||
)
|
||||
|
||||
func (e GetSearchAllLibrariesEnableCreditsMarkerGeneration) ToPointer() *GetSearchAllLibrariesEnableCreditsMarkerGeneration {
|
||||
return &e
|
||||
}
|
||||
func (e *GetSearchAllLibrariesEnableCreditsMarkerGeneration) UnmarshalJSON(data []byte) error {
|
||||
var v string
|
||||
if err := json.Unmarshal(data, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
switch v {
|
||||
case "-1":
|
||||
fallthrough
|
||||
case "0":
|
||||
*e = GetSearchAllLibrariesEnableCreditsMarkerGeneration(v)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("invalid value for GetSearchAllLibrariesEnableCreditsMarkerGeneration: %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
// GetSearchAllLibrariesShowOrdering - Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1214,17 +1275,22 @@ type GetSearchAllLibrariesMetadata struct {
|
||||
LibrarySectionKey *string `json:"librarySectionKey,omitempty"`
|
||||
// The type of media content
|
||||
//
|
||||
Type GetSearchAllLibrariesType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Slug *string `json:"slug,omitempty"`
|
||||
ContentRating *string `json:"contentRating,omitempty"`
|
||||
Summary string `json:"summary"`
|
||||
Rating *float64 `json:"rating,omitempty"`
|
||||
AudienceRating *float64 `json:"audienceRating,omitempty"`
|
||||
Year *int `json:"year,omitempty"`
|
||||
SeasonCount *int `json:"seasonCount,omitempty"`
|
||||
Tagline *string `json:"tagline,omitempty"`
|
||||
FlattenSeasons *GetSearchAllLibrariesFlattenSeasons `default:"0" json:"flattenSeasons"`
|
||||
Type GetSearchAllLibrariesType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Slug *string `json:"slug,omitempty"`
|
||||
ContentRating *string `json:"contentRating,omitempty"`
|
||||
Summary string `json:"summary"`
|
||||
Rating *float64 `json:"rating,omitempty"`
|
||||
AudienceRating *float64 `json:"audienceRating,omitempty"`
|
||||
Year *int `json:"year,omitempty"`
|
||||
SeasonCount *int `json:"seasonCount,omitempty"`
|
||||
Tagline *string `json:"tagline,omitempty"`
|
||||
// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
|
||||
FlattenSeasons *GetSearchAllLibrariesFlattenSeasons `json:"flattenSeasons,omitempty"`
|
||||
// Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
|
||||
EpisodeSort *GetSearchAllLibrariesEpisodeSort `json:"episodeSort,omitempty"`
|
||||
// Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
|
||||
EnableCreditsMarkerGeneration *GetSearchAllLibrariesEnableCreditsMarkerGeneration `json:"enableCreditsMarkerGeneration,omitempty"`
|
||||
// Setting that indicates the episode ordering for the show
|
||||
// None = Library default,
|
||||
// tmdbAiring = The Movie Database (Aired),
|
||||
@@ -1441,6 +1507,20 @@ func (o *GetSearchAllLibrariesMetadata) GetFlattenSeasons() *GetSearchAllLibrari
|
||||
return o.FlattenSeasons
|
||||
}
|
||||
|
||||
func (o *GetSearchAllLibrariesMetadata) GetEpisodeSort() *GetSearchAllLibrariesEpisodeSort {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EpisodeSort
|
||||
}
|
||||
|
||||
func (o *GetSearchAllLibrariesMetadata) GetEnableCreditsMarkerGeneration() *GetSearchAllLibrariesEnableCreditsMarkerGeneration {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return o.EnableCreditsMarkerGeneration
|
||||
}
|
||||
|
||||
func (o *GetSearchAllLibrariesMetadata) GetShowOrdering() *GetSearchAllLibrariesShowOrdering {
|
||||
if o == nil {
|
||||
return nil
|
||||
|
||||
@@ -544,7 +544,7 @@ type GetTokenDetailsUserPlexAccount struct {
|
||||
MaxHomeSize int `json:"maxHomeSize"`
|
||||
// [Might be removed] The hashed Plex Home PIN
|
||||
//
|
||||
// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||
// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||
Pin *string `json:"pin,omitempty"`
|
||||
Profile UserProfile `json:"profile"`
|
||||
// If the account has a Plex Home PIN enabled
|
||||
|
||||
@@ -830,7 +830,7 @@ type PostUsersSignInDataUserPlexAccount struct {
|
||||
MaxHomeSize int `json:"maxHomeSize"`
|
||||
// [Might be removed] The hashed Plex Home PIN
|
||||
//
|
||||
// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||
// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||
Pin *string `json:"pin,omitempty"`
|
||||
Profile PostUsersSignInDataUserProfile `json:"profile"`
|
||||
// If the account has a Plex Home PIN enabled
|
||||
|
||||
54
playlists.go
54
playlists.go
@@ -256,7 +256,11 @@ func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.Creat
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -505,7 +509,11 @@ func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.P
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -750,7 +758,11 @@ func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64, opts ..
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -974,7 +986,11 @@ func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64, opts
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1204,7 +1220,11 @@ func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64, titl
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1456,7 +1476,11 @@ func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64,
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1680,7 +1704,11 @@ func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float6
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1931,7 +1959,11 @@ func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64,
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2161,7 +2193,11 @@ func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force opera
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
42
plex.go
42
plex.go
@@ -246,7 +246,11 @@ func (s *Plex) GetCompanionsData(ctx context.Context, opts ...operations.Option)
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -485,7 +489,11 @@ func (s *Plex) GetUserFriends(ctx context.Context, opts ...operations.Option) (*
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -720,7 +728,11 @@ func (s *Plex) GetGeoData(ctx context.Context, opts ...operations.Option) (*oper
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -960,7 +972,11 @@ func (s *Plex) GetHomeData(ctx context.Context, opts ...operations.Option) (*ope
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1212,7 +1228,11 @@ func (s *Plex) GetServerResources(ctx context.Context, clientID string, includeH
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1431,7 +1451,11 @@ func (s *Plex) GetPin(ctx context.Context, request operations.GetPinRequest, opt
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1668,7 +1692,11 @@ func (s *Plex) GetTokenByPinID(ctx context.Context, request operations.GetTokenB
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -298,9 +298,9 @@ func New(opts ...SDKOption) *PlexAPI {
|
||||
sdkConfiguration: sdkConfiguration{
|
||||
Language: "go",
|
||||
OpenAPIDocVersion: "0.0.3",
|
||||
SDKVersion: "0.17.1",
|
||||
GenVersion: "2.483.1",
|
||||
UserAgent: "speakeasy-sdk/go 0.17.1 2.483.1 0.0.3 github.com/LukeHagar/plexgo",
|
||||
SDKVersion: "0.17.2",
|
||||
GenVersion: "2.496.0",
|
||||
UserAgent: "speakeasy-sdk/go 0.17.2 2.496.0 0.0.3 github.com/LukeHagar/plexgo",
|
||||
ServerDefaults: []map[string]string{
|
||||
{
|
||||
"protocol": "https",
|
||||
|
||||
@@ -20,6 +20,9 @@ type BackoffStrategy struct {
|
||||
|
||||
// Config configures a retry policy.
|
||||
type Config struct {
|
||||
// Strategy sets the algorithm to use for a retry loop. It can be one of:
|
||||
// - "backoff": retry with exponential backoff and random jitter.
|
||||
// - "none" or "": disables retries.
|
||||
Strategy string
|
||||
Backoff *BackoffStrategy
|
||||
RetryConnectionErrors bool
|
||||
|
||||
18
search.go
18
search.go
@@ -249,7 +249,11 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -482,7 +486,11 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -730,7 +738,11 @@ func (s *Search) GetSearchResults(ctx context.Context, query string, opts ...ope
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
54
server.go
54
server.go
@@ -247,7 +247,11 @@ func (s *Server) GetServerCapabilities(ctx context.Context, opts ...operations.O
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -487,7 +491,11 @@ func (s *Server) GetServerPreferences(ctx context.Context, opts ...operations.Op
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -727,7 +735,11 @@ func (s *Server) GetAvailableClients(ctx context.Context, opts ...operations.Opt
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -967,7 +979,11 @@ func (s *Server) GetDevices(ctx context.Context, opts ...operations.Option) (*op
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1181,7 +1197,11 @@ func (s *Server) GetServerIdentity(ctx context.Context, opts ...operations.Optio
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1421,7 +1441,11 @@ func (s *Server) GetMyPlexAccount(ctx context.Context, opts ...operations.Option
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1645,7 +1669,11 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -1891,7 +1919,11 @@ func (s *Server) GetMediaProviders(ctx context.Context, xPlexToken string, opts
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -2131,7 +2163,11 @@ func (s *Server) GetServerList(ctx context.Context, opts ...operations.Option) (
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
24
sessions.go
24
sessions.go
@@ -247,7 +247,11 @@ func (s *Sessions) GetSessions(ctx context.Context, opts ...operations.Option) (
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -498,7 +502,11 @@ func (s *Sessions) GetSessionHistory(ctx context.Context, sort *string, accountI
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -738,7 +746,11 @@ func (s *Sessions) GetTranscodeSessions(ctx context.Context, opts ...operations.
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -962,7 +974,11 @@ func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string,
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -255,7 +255,11 @@ func (s *Statistics) GetStatistics(ctx context.Context, timespan *int64, opts ..
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -503,7 +507,11 @@ func (s *Statistics) GetResourcesStatistics(ctx context.Context, timespan *int64
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -751,7 +759,11 @@ func (s *Statistics) GetBandwidthStatistics(ctx context.Context, timespan *int64
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
20
updater.go
20
updater.go
@@ -248,7 +248,11 @@ func (s *Updater) GetUpdateStatus(ctx context.Context, opts ...operations.Option
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -476,7 +480,11 @@ func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Down
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -704,8 +712,6 @@ func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight,
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode == 500:
|
||||
fallthrough
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
@@ -714,6 +720,12 @@ func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight,
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
default:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
12
video.go
12
video.go
@@ -231,7 +231,11 @@ func (s *Video) GetTimeline(ctx context.Context, request operations.GetTimelineR
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
@@ -455,7 +459,11 @@ func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
@@ -251,7 +251,11 @@ func (s *Watchlist) GetWatchList(ctx context.Context, request operations.GetWatc
|
||||
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
|
||||
}
|
||||
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
|
||||
fallthrough
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
|
||||
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
|
||||
rawBody, err := utils.ConsumeRawBody(httpRes)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user