Compare commits

...

23 Commits

Author SHA1 Message Date
speakeasybot
a34f15746e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.285.0 2024-05-08 18:15:46 +00:00
speakeasybot
12afbc6467 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.283.1 2024-05-08 00:39:09 +00:00
speakeasybot
8267c3fcbd ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.280.1 2024-05-07 00:47:31 +00:00
speakeasybot
3f2fc4fe8c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.279.0 2024-05-06 00:48:33 +00:00
speakeasybot
21517ca298 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.279.0 2024-05-05 00:51:13 +00:00
speakeasybot
d7fe60ed91 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.279.0 2024-05-04 00:47:01 +00:00
speakeasybot
b09c6ad37a ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.277.8 2024-05-03 00:50:55 +00:00
speakeasybot
6a5cd06342 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.277.4 2024-05-02 00:46:14 +00:00
speakeasybot
9531527f23 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.277.4 2024-05-01 00:51:24 +00:00
speakeasybot
db2b15241c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.277.0 2024-04-30 00:46:14 +00:00
speakeasybot
344db7cbcb ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.276.0 2024-04-29 00:47:45 +00:00
speakeasybot
af9748433a ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.276.0 2024-04-28 00:51:17 +00:00
speakeasybot
8f332b739e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.276.0 2024-04-27 00:45:49 +00:00
speakeasybot
c504a2d46e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.274.1 2024-04-26 00:46:33 +00:00
speakeasybot
95d64024f2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.274.1 2024-04-25 00:49:21 +00:00
speakeasybot
457b36fb49 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.271.0 2024-04-24 00:45:46 +00:00
Luke Hagar
8691720920 Added code samples and regenerated 2024-04-23 13:50:17 -05:00
Luke Hagar
205c454485 Update gen.yaml 2024-04-23 13:49:15 -05:00
Luke Hagar
71b5f4f4b7 Migrated to workflows 2024-04-23 13:48:49 -05:00
Luke Hagar
f3779b0079 Moved gen.yaml 2024-04-23 13:48:40 -05:00
Luke Hagar
0eaf609b40 Updated generation action 2024-04-23 13:48:31 -05:00
speakeasy-github[bot]
b0931cba2e chore: update dependencies 2024-04-22 16:15:36 +00:00
speakeasybot
d09f9292ce ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.267.2 2024-04-22 16:15:05 +00:00
66 changed files with 1147 additions and 1795 deletions

View File

@@ -1,29 +1,25 @@
name: Generate name: Generate
permissions: permissions:
checks: write checks: write
contents: write contents: write
pull-requests: write pull-requests: write
statuses: write statuses: write
"on": "on":
workflow_dispatch: workflow_dispatch:
inputs: inputs:
force: force:
description: Force generation of SDKs description: Force generation of SDKs
type: boolean type: boolean
default: false default: false
schedule: schedule:
- cron: 0 0 * * * - cron: 0 0 * * *
jobs: jobs:
generate: generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-generation.yaml@v14 uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with: with:
force: ${{ github.event.inputs.force }} force: ${{ github.event.inputs.force }}
languages: | mode: direct
- go speakeasy_version: latest
mode: direct secrets:
openapi_docs: | github_access_token: ${{ secrets.GITHUB_TOKEN }}
- https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

View File

@@ -1,27 +1,33 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 id: dfa99515-01c0-42eb-9be5-ee212fd03eb3
management: management:
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae docChecksum: 543cb95355401d2e3c2ba11a50d9dd94
docVersion: 0.0.3 docVersion: 0.0.3
speakeasyVersion: 1.245.0 speakeasyVersion: 1.285.0
generationVersion: 2.301.3 generationVersion: 2.326.3
releaseVersion: 0.6.3 releaseVersion: 0.7.0
configChecksum: 305403acfb42fec7c8e5f2903b30cf41 configChecksum: 98c0e864ba8f7c2e3b366fd643dd90ab
repoURL: https://github.com/LukeHagar/plexgo.git repoURL: https://github.com/LukeHagar/plexgo.git
repoSubDirectory: . repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexgo installationURL: https://github.com/LukeHagar/plexgo
published: true published: true
features: features:
go: go:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.4 constsAndDefaults: 0.1.4
core: 3.4.6 core: 3.4.7
flattening: 2.81.1 flattening: 2.81.1
globalSecurity: 2.82.9 globalSecurity: 2.82.9
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.2 globalServerURLs: 2.82.2
globals: 2.82.2 globals: 2.82.2
intellisenseMarkdownSupport: 0.1.0
methodServerURLs: 2.82.1 methodServerURLs: 2.82.1
nameOverrides: 2.81.2 nameOverrides: 2.81.2
responseFormat: 0.1.0 responseFormat: 0.1.1
sdkHooks: 0.1.0
unions: 2.85.5
generatedFiles: generatedFiles:
- server.go - server.go
- media.go - media.go
@@ -87,7 +93,6 @@ generatedFiles:
- /models/operations/getlibraries.go - /models/operations/getlibraries.go
- /models/operations/getlibrary.go - /models/operations/getlibrary.go
- /models/operations/deletelibrary.go - /models/operations/deletelibrary.go
- /models/operations/getlibraryitems.go
- /models/operations/refreshlibrary.go - /models/operations/refreshlibrary.go
- /models/operations/searchlibrary.go - /models/operations/searchlibrary.go
- /models/operations/getmetadata.go - /models/operations/getmetadata.go
@@ -307,19 +312,6 @@ generatedFiles:
- docs/models/operations/getlibraryresponse.md - docs/models/operations/getlibraryresponse.md
- docs/models/operations/deletelibraryrequest.md - docs/models/operations/deletelibraryrequest.md
- docs/models/operations/deletelibraryresponse.md - docs/models/operations/deletelibraryresponse.md
- docs/models/operations/tag.md
- docs/models/operations/getlibraryitemsrequest.md
- docs/models/operations/getlibraryitemspart.md
- docs/models/operations/getlibraryitemsmedia.md
- docs/models/operations/getlibraryitemsgenre.md
- docs/models/operations/getlibraryitemscountry.md
- docs/models/operations/getlibraryitemsdirector.md
- docs/models/operations/getlibraryitemswriter.md
- docs/models/operations/getlibraryitemsrole.md
- docs/models/operations/getlibraryitemsmetadata.md
- docs/models/operations/getlibraryitemsmediacontainer.md
- docs/models/operations/getlibraryitemsresponsebody.md
- docs/models/operations/getlibraryitemsresponse.md
- docs/models/operations/refreshlibraryrequest.md - docs/models/operations/refreshlibraryrequest.md
- docs/models/operations/refreshlibraryresponse.md - docs/models/operations/refreshlibraryresponse.md
- docs/models/operations/type.md - docs/models/operations/type.md

View File

@@ -6,13 +6,13 @@ generation:
optionalPropertyRendering: withExample optionalPropertyRendering: withExample
useClassNamesForArrayFields: true useClassNamesForArrayFields: true
fixes: fixes:
nameResolutionDec2023: false nameResolutionDec2023: true
parameterOrderingFeb2024: false parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: false requestResponseComponentNamesFeb2024: true
auth: auth:
oAuth2ClientCredentialsEnabled: false oAuth2ClientCredentialsEnabled: true
go: go:
version: 0.6.3 version: 0.7.0
additionalDependencies: {} additionalDependencies: {}
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true flattenGlobalSecurity: true
@@ -26,6 +26,7 @@ go:
webhooks: models/webhooks webhooks: models/webhooks
inputModelSuffix: input inputModelSuffix: input
maxMethodParams: 4 maxMethodParams: 4
methodArguments: require-security-and-request
outputModelSuffix: output outputModelSuffix: output
packageName: github.com/LukeHagar/plexgo packageName: github.com/LukeHagar/plexgo
responseFormat: envelope responseFormat: envelope

16
.speakeasy/workflow.lock Normal file
View File

@@ -0,0 +1,16 @@
speakeasyVersion: 1.285.0
sources: {}
targets: {}
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
targets:
plexgo:
target: go
source: my-source
codeSamples:
output: codeSamples.yaml

12
.speakeasy/workflow.yaml Normal file
View File

@@ -0,0 +1,12 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
targets:
plexgo:
target: go
source: my-source
codeSamples:
output: codeSamples.yaml

View File

@@ -33,7 +33,7 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
@@ -105,7 +105,6 @@ func main() {
* [GetLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries * [GetLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries
* [GetLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details * [GetLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section * [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library * [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library
* [SearchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library * [SearchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library
* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata * [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata
@@ -185,7 +184,7 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
@@ -236,7 +235,7 @@ func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithServerIndex(0), plexgo.WithServerIndex(0),
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
@@ -275,7 +274,7 @@ func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithServerURL("{protocol}://{ip}:{port}"), plexgo.WithServerURL("{protocol}://{ip}:{port}"),
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
@@ -304,15 +303,15 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var strong *bool = plexgo.Bool(false) var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>") var xPlexClientIdentifier *string = plexgo.String("Postman")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetPin(ctx, operations.WithServerURL("https://plex.tv/api/v2"), strong, xPlexClientIdentifier) res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier, operations.WithServerURL("https://plex.tv/api/v2"))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -377,7 +376,7 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
@@ -424,7 +423,7 @@ d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on
A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"<value>"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals ### Available Globals
@@ -452,12 +451,12 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var strong *bool = plexgo.Bool(false) var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>") var xPlexClientIdentifier *string = plexgo.String("Postman")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier) res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier)

View File

@@ -238,4 +238,168 @@ Based on:
### Generated ### Generated
- [go v0.6.3] . - [go v0.6.3] .
### Releases ### Releases
- [Go v0.6.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.3 - . - [Go v0.6.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.3 - .
## 2024-04-22 16:14:47
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.267.2 (2.312.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.4] .
### Releases
- [Go v0.6.4] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.4 - .
## 2024-04-24 00:45:20
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.271.0 (2.312.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
## 2024-04-25 00:48:55
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.274.1 (2.314.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
## 2024-04-26 00:46:09
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.274.1 (2.314.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
## 2024-04-27 00:45:23
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.276.0 (2.314.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-04-28 00:50:52
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.276.0 (2.314.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-04-29 00:47:20
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.276.0 (2.314.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-04-30 00:45:49
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.277.0 (2.317.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-05-01 00:50:59
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.277.4 (2.318.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-05-02 00:45:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.277.4 (2.318.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.5] .
### Releases
- [Go v0.6.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.5 - .
## 2024-05-03 00:50:00
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.277.8 (2.319.10) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.6] .
### Releases
- [Go v0.6.6] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.6 - .
## 2024-05-04 00:46:06
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.279.0 (2.322.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.7] .
### Releases
- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - .
## 2024-05-05 00:50:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.279.0 (2.322.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.7] .
### Releases
- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - .
## 2024-05-06 00:48:07
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.279.0 (2.322.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.7] .
### Releases
- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - .
## 2024-05-07 00:47:05
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.280.1 (2.322.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.7] .
### Releases
- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - .
## 2024-05-08 00:38:43
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.283.1 (2.324.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.7] .
### Releases
- [Go v0.6.7] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.7 - .
## 2024-05-08 18:14:51
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.285.0 (2.326.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.7.0] .
### Releases
- [Go v0.7.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.7.0 - .

View File

@@ -12,7 +12,7 @@ import (
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -75,9 +75,11 @@ func (s *Activities) GetServerActivities(ctx context.Context) (*operations.GetSe
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -185,9 +187,11 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -78,9 +78,11 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -182,9 +184,11 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -69,9 +69,11 @@ func (s *Butler) GetButlerTasks(ctx context.Context) (*operations.GetButlerTasks
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -179,9 +181,11 @@ func (s *Butler) StartAllTasks(ctx context.Context) (*operations.StartAllTasksRe
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -274,9 +278,11 @@ func (s *Butler) StopAllTasks(ctx context.Context) (*operations.StopAllTasksResp
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -377,9 +383,11 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName) (*
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -478,9 +486,11 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

359
codeSamples.yaml Normal file
View File

@@ -0,0 +1,359 @@
overlay: 1.0.0
info:
title: CodeSamples overlay for go target
version: 0.0.0
actions:
- target: $["paths"]["/pins"]["post"]
update:
x-codeSamples:
- lang: go
label: getPin
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var strong *bool = plexgo.Bool(false)\n\n var xPlexClientIdentifier *string = plexgo.String(\"Postman\")\n \n ctx := context.Background()\n res, err := s.GetPin(ctx, strong, xPlexClientIdentifier)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/pins/{pinID}"]["get"]
update:
x-codeSamples:
- lang: go
label: getToken
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var pinID string = \"<value>\"\n\n var xPlexClientIdentifier *string = plexgo.String(\"Postman\")\n \n ctx := context.Background()\n res, err := s.GetToken(ctx, pinID, xPlexClientIdentifier)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/devices"]["get"]
update:
x-codeSamples:
- lang: go
label: getDevices
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetDevices(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/hubs/search"]["get"]
update:
x-codeSamples:
- lang: go
label: performSearch
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var query string = \"dylan\"\n\n var sectionID *float64 = plexgo.Float64(1516.53)\n\n var limit *float64 = plexgo.Float64(5)\n \n ctx := context.Background()\n res, err := s.PerformSearch(ctx, query, sectionID, limit)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/log"]["post"]
update:
x-codeSamples:
- lang: go
label: logMultiLine
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var request string = \"level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman\"\n \n ctx := context.Background()\n res, err := s.LogMultiLine(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/sections"]["get"]
update:
x-codeSamples:
- lang: go
label: getLibraries
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetLibraries(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
update:
x-codeSamples:
- lang: go
label: getMetadata
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var ratingKey float64 = 8382.31\n \n ctx := context.Background()\n res, err := s.GetMetadata(ctx, ratingKey)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/myplex/account"]["get"]
update:
x-codeSamples:
- lang: go
label: getMyPlexAccount
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetMyPlexAccount(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/activities"]["get"]
update:
x-codeSamples:
- lang: go
label: getServerActivities
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetServerActivities(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
update:
x-codeSamples:
- lang: go
label: clearPlaylistContents
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 1893.18\n \n ctx := context.Background()\n res, err := s.ClearPlaylistContents(ctx, playlistID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/:/scrobble"]["get"]
update:
x-codeSamples:
- lang: go
label: markPlayed
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var key float64 = 59398\n \n ctx := context.Background()\n res, err := s.MarkPlayed(ctx, key)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/search"]["get"]
update:
x-codeSamples:
- lang: go
label: getSearchResults
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var query string = \"110\"\n \n ctx := context.Background()\n res, err := s.GetSearchResults(ctx, query)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/recentlyAdded"]["get"]
update:
x-codeSamples:
- lang: go
label: getRecentlyAdded
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetRecentlyAdded(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
update:
x-codeSamples:
- lang: go
label: getMetadataChildren
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var ratingKey float64 = 1539.14\n \n ctx := context.Background()\n res, err := s.GetMetadataChildren(ctx, ratingKey)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}"]["put"]
update:
x-codeSamples:
- lang: go
label: updatePlaylist
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 3915\n\n var title *string = plexgo.String(\"<value>\")\n\n var summary *string = plexgo.String(\"<value>\")\n \n ctx := context.Background()\n res, err := s.UpdatePlaylist(ctx, playlistID, title, summary)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/identity"]["get"]
update:
x-codeSamples:
- lang: go
label: getServerIdentity
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetServerIdentity(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
update:
x-codeSamples:
- lang: go
label: startUniversalTranscode
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n request := operations.StartUniversalTranscodeRequest{\n HasMDE: 1,\n Path: \"/library/metadata/23409\",\n MediaIndex: 0,\n PartIndex: 0,\n Protocol: \"hls\",\n FastSeek: plexgo.Float64(0),\n DirectPlay: plexgo.Float64(0),\n DirectStream: plexgo.Float64(0),\n SubtitleSize: plexgo.Float64(100),\n Subtites: plexgo.String(\"burn\"),\n AudioBoost: plexgo.Float64(100),\n Location: plexgo.String(\"lan\"),\n MediaBufferSize: plexgo.Float64(102400),\n Session: plexgo.String(\"zvcage8b7rkioqcm8f4uns4c\"),\n AddDebugOverlay: plexgo.Float64(0),\n AutoAdjustQuality: plexgo.Float64(0),\n }\n \n ctx := context.Background()\n res, err := s.StartUniversalTranscode(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/butler"]["delete"]
update:
x-codeSamples:
- lang: go
label: stopAllTasks
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.StopAllTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"]
update:
x-codeSamples:
- lang: go
label: refreshLibrary
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sectionID float64 = 934.16\n \n ctx := context.Background()\n res, err := s.RefreshLibrary(ctx, sectionID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists"]["get"]
update:
x-codeSamples:
- lang: go
label: getPlaylists
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio.ToPointer()\n\n var smart *operations.QueryParamSmart = operations.QueryParamSmartZero.ToPointer()\n \n ctx := context.Background()\n res, err := s.GetPlaylists(ctx, playlistType, smart)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
update:
x-codeSamples:
- lang: go
label: deletePlaylist
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 216.22\n \n ctx := context.Background()\n res, err := s.DeletePlaylist(ctx, playlistID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
update:
x-codeSamples:
- lang: go
label: addPlaylistContents
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 8502.01\n\n var uri string = \"server://12345/com.plexapp.plugins.library/library/metadata/1\"\n\n var playQueueID *float64 = plexgo.Float64(123)\n \n ctx := context.Background()\n res, err := s.AddPlaylistContents(ctx, playlistID, uri, playQueueID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/butler/{taskName}"]["delete"]
update:
x-codeSamples:
- lang: go
label: stopTask
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase\n \n ctx := context.Background()\n res, err := s.StopTask(ctx, taskName)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/hashes"]["get"]
update:
x-codeSamples:
- lang: go
label: getFileHash
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var url_ string = \"file://C:\\Image.png&type=13\"\n\n var type_ *float64 = plexgo.Float64(4462.17)\n \n ctx := context.Background()\n res, err := s.GetFileHash(ctx, url_, type_)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/transcode/sessions"]["get"]
update:
x-codeSamples:
- lang: go
label: getTranscodeSessions
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetTranscodeSessions(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/hubs"]["get"]
update:
x-codeSamples:
- lang: go
label: getGlobalHubs
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var count *float64 = plexgo.Float64(1262.49)\n\n var onlyTransient *operations.OnlyTransient = operations.OnlyTransientOne.ToPointer()\n \n ctx := context.Background()\n res, err := s.GetGlobalHubs(ctx, count, onlyTransient)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/sections/{sectionId}"]["delete"]
update:
x-codeSamples:
- lang: go
label: deleteLibrary
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sectionID float64 = 1000\n \n ctx := context.Background()\n res, err := s.DeleteLibrary(ctx, sectionID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists"]["post"]
update:
x-codeSamples:
- lang: go
label: createPlaylist
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n request := operations.CreatePlaylistRequest{\n Title: \"<value>\",\n Type: operations.QueryParamTypePhoto,\n Smart: operations.SmartOne,\n URI: \"https://inborn-brochure.biz\",\n }\n \n ctx := context.Background()\n res, err := s.CreatePlaylist(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/:/prefs"]["get"]
update:
x-codeSamples:
- lang: go
label: getServerPreferences
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetServerPreferences(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/butler/{taskName}"]["post"]
update:
x-codeSamples:
- lang: go
label: startTask
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var taskName operations.TaskName = operations.TaskNameCleanOldBundles\n \n ctx := context.Background()\n res, err := s.StartTask(ctx, taskName)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/log"]["get"]
update:
x-codeSamples:
- lang: go
label: logLine
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var level operations.Level = operations.LevelThree\n\n var message string = \"Test log message\"\n\n var source string = \"Postman\"\n \n ctx := context.Background()\n res, err := s.LogLine(ctx, level, message, source)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/:/timeline"]["get"]
update:
x-codeSamples:
- lang: go
label: getTimeline
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n request := operations.GetTimelineRequest{\n RatingKey: 23409,\n Key: \"/library/metadata/23409\",\n State: operations.StatePlaying,\n HasMDE: 1,\n Time: 2000,\n Duration: 10000,\n Context: \"home:hub.continueWatching\",\n PlayQueueItemID: 1,\n PlayBackTime: 2000,\n Row: 1,\n }\n \n ctx := context.Background()\n res, err := s.GetTimeline(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/butler"]["post"]
update:
x-codeSamples:
- lang: go
label: startAllTasks
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.StartAllTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/hubs/search/voice"]["get"]
update:
x-codeSamples:
- lang: go
label: performVoiceSearch
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var query string = \"dead+poop\"\n\n var sectionID *float64 = plexgo.Float64(4094.8)\n\n var limit *float64 = plexgo.Float64(5)\n \n ctx := context.Background()\n res, err := s.PerformVoiceSearch(ctx, query, sectionID, limit)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/sections/{sectionId}/search"]["get"]
update:
x-codeSamples:
- lang: go
label: searchLibrary
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sectionID int64 = 933505\n\n var type_ operations.Type = operations.TypeFour\n \n ctx := context.Background()\n res, err := s.SearchLibrary(ctx, sectionID, type_)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/status/sessions"]["get"]
update:
x-codeSamples:
- lang: go
label: getSessions
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetSessions(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/updater/apply"]["put"]
update:
x-codeSamples:
- lang: go
label: applyUpdates
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var tonight *operations.Tonight = operations.TonightOne.ToPointer()\n\n var skip *operations.Skip = operations.SkipOne.ToPointer()\n \n ctx := context.Background()\n res, err := s.ApplyUpdates(ctx, tonight, skip)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/clients"]["get"]
update:
x-codeSamples:
- lang: go
label: getAvailableClients
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAvailableClients(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/:/progress"]["post"]
update:
x-codeSamples:
- lang: go
label: updatePlayProgress
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var key string = \"<value>\"\n\n var time float64 = 90000\n\n var state string = \"played\"\n \n ctx := context.Background()\n res, err := s.UpdatePlayProgress(ctx, key, time, state)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
update:
x-codeSamples:
- lang: go
label: getLibraryHubs
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sectionID float64 = 6728.76\n\n var count *float64 = plexgo.Float64(9010.22)\n\n var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero.ToPointer()\n \n ctx := context.Background()\n res, err := s.GetLibraryHubs(ctx, sectionID, count, onlyTransient)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/security/resources"]["get"]
update:
x-codeSamples:
- lang: go
label: getSourceConnectionInformation
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var source string = \"server://client-identifier\"\n \n ctx := context.Background()\n res, err := s.GetSourceConnectionInformation(ctx, source)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/updater/status"]["get"]
update:
x-codeSamples:
- lang: go
label: getUpdateStatus
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetUpdateStatus(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/servers"]["get"]
update:
x-codeSamples:
- lang: go
label: getServerList
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetServerList(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
update:
x-codeSamples:
- lang: go
label: cancelServerActivities
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var activityUUID string = \"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\"\n \n ctx := context.Background()\n res, err := s.CancelServerActivities(ctx, activityUUID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/log/networked"]["get"]
update:
x-codeSamples:
- lang: go
label: enablePaperTrail
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.EnablePaperTrail(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
update:
x-codeSamples:
- lang: go
label: getPlaylistContents
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 5004.46\n\n var type_ float64 = 9403.59\n \n ctx := context.Background()\n res, err := s.GetPlaylistContents(ctx, playlistID, type_)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/upload"]["post"]
update:
x-codeSamples:
- lang: go
label: uploadPlaylist
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var path string = \"/home/barkley/playlist.m3u\"\n\n var force operations.Force = operations.ForceZero\n \n ctx := context.Background()\n res, err := s.UploadPlaylist(ctx, path, force)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/statistics/media"]["get"]
update:
x-codeSamples:
- lang: go
label: getStatistics
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var timespan *int64 = plexgo.Int64(4)\n \n ctx := context.Background()\n res, err := s.GetStatistics(ctx, timespan)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/butler"]["get"]
update:
x-codeSamples:
- lang: go
label: getButlerTasks
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetButlerTasks(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/security/token"]["get"]
update:
x-codeSamples:
- lang: go
label: getTransientToken
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation\n\n var scope operations.Scope = operations.ScopeAll\n \n ctx := context.Background()\n res, err := s.GetTransientToken(ctx, type_, scope)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/status/sessions/history/all"]["get"]
update:
x-codeSamples:
- lang: go
label: getSessionHistory
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetSessionHistory(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/"]["get"]
update:
x-codeSamples:
- lang: go
label: getServerCapabilities
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetServerCapabilities(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/photo/:/transcode"]["get"]
update:
x-codeSamples:
- lang: go
label: getResizedPhoto
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n request := operations.GetResizedPhotoRequest{\n Width: 110,\n Height: 165,\n Opacity: 100,\n Blur: 20,\n MinSize: operations.MinSizeOne,\n Upscale: operations.UpscaleZero,\n URL: \"/library/metadata/49564/thumb/1654258204\",\n }\n \n ctx := context.Background()\n res, err := s.GetResizedPhoto(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/:/unscrobble"]["get"]
update:
x-codeSamples:
- lang: go
label: markUnplayed
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var key float64 = 59398\n \n ctx := context.Background()\n res, err := s.MarkUnplayed(ctx, key)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/sections/{sectionId}"]["get"]
update:
x-codeSamples:
- lang: go
label: getLibrary
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sectionID float64 = 1000\n\n var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer()\n \n ctx := context.Background()\n res, err := s.GetLibrary(ctx, sectionID, includeDetails)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/library/onDeck"]["get"]
update:
x-codeSamples:
- lang: go
label: getOnDeck
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetOnDeck(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/playlists/{playlistID}"]["get"]
update:
x-codeSamples:
- lang: go
label: getPlaylist
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var playlistID float64 = 4109.48\n \n ctx := context.Background()\n res, err := s.GetPlaylist(ctx, playlistID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Object != nil {\n // handle response\n }\n}"
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
update:
x-codeSamples:
- lang: go
label: stopTranscodeSession
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var sessionKey string = \"zz7llzqlx8w9vnrsbnwhbmep\"\n \n ctx := context.Background()\n res, err := s.StopTranscodeSession(ctx, sessionKey)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/updater/check"]["put"]
update:
x-codeSamples:
- lang: go
label: checkForUpdates
source: "package main\n\nimport(\n\t\"github.com/LukeHagar/plexgo/models/components\"\n\t\"github.com/LukeHagar/plexgo\"\n\t\"github.com/LukeHagar/plexgo/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := plexgo.New(\n plexgo.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n plexgo.WithXPlexClientIdentifier(\"Postman\"),\n )\n\n var download *operations.Download = operations.DownloadOne.ToPointer()\n \n ctx := context.Background()\n res, err := s.CheckForUpdates(ctx, download)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"

View File

@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | | `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | | `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | 1 |

View File

@@ -3,6 +3,6 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | | `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |

View File

@@ -3,6 +3,6 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | | `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |

View File

@@ -1,8 +0,0 @@
# GetLibraryItemsCountry
## Fields
| Field | Type | Required | Description | Example |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America |

View File

@@ -1,8 +0,0 @@
# GetLibraryItemsDirector
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Tag` | **string* | :heavy_minus_sign: | N/A | James Cameron |

View File

@@ -1,8 +0,0 @@
# GetLibraryItemsGenre
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Tag` | **string* | :heavy_minus_sign: | N/A | Adventure |

View File

@@ -1,21 +0,0 @@
# GetLibraryItemsMedia
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ID` | **int* | :heavy_minus_sign: | N/A | 119534 |
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
| `Bitrate` | **int* | :heavy_minus_sign: | N/A | 25025 |
| `Width` | **int* | :heavy_minus_sign: | N/A | 3840 |
| `Height` | **int* | :heavy_minus_sign: | N/A | 2072 |
| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 1.85 |
| `AudioChannels` | **int* | :heavy_minus_sign: | N/A | 6 |
| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | eac3 |
| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | hevc |
| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 4k |
| `Container` | **string* | :heavy_minus_sign: | N/A | mkv |
| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p |
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |
| `Part` | [][operations.GetLibraryItemsPart](../../models/operations/getlibraryitemspart.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"id": 119542,<br/>"key": "/library/parts/119542/1680457526/file.mkv",<br/>"duration": 11558112,<br/>"file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv",<br/>"size": 36158371307,<br/>"container": "mkv",<br/>"videoProfile": "main 10"<br/>}<br/>] |

File diff suppressed because one or more lines are too long

View File

@@ -1,64 +0,0 @@
# GetLibraryItemsMetadata
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 58683 |
| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683 |
| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
| `Studio` | **string* | :heavy_minus_sign: | N/A | 20th Century Studios |
| `Type` | **string* | :heavy_minus_sign: | N/A | movie |
| `Title` | **string* | :heavy_minus_sign: | N/A | Avatar: The Way of Water |
| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 |
| `Summary` | **string* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. |
| `Rating` | **float64* | :heavy_minus_sign: | N/A | 7.6 |
| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 9.2 |
| `Year` | **int* | :heavy_minus_sign: | N/A | 2022 |
| `Tagline` | **string* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
| `OriginallyAvailableAt` | [*types.Date](../../types/date.md) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC |
| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1680457607 |
| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1703239236 |
| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright |
| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media |
| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
| `RatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe |
| `GrandparentRatingKey` | **string* | :heavy_minus_sign: | N/A | 66 |
| `GrandparentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Caprica |
| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
| `GrandparentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
| `Media` | [][operations.GetLibraryItemsMedia](../../models/operations/getlibraryitemsmedia.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"id": 119534,<br/>"duration": 11558112,<br/>"bitrate": 25025,<br/>"width": 3840,<br/>"height": 2072,<br/>"aspectRatio": 1.85,<br/>"audioChannels": 6,<br/>"audioCodec": "eac3",<br/>"videoCodec": "hevc",<br/>"videoResolution": "4k",<br/>"container": "mkv",<br/>"videoFrameRate": "24p",<br/>"videoProfile": "main 10",<br/>"Part": [<br/>{<br/>"id": 119542,<br/>"key": "/library/parts/119542/1680457526/file.mkv",<br/>"duration": 11558112,<br/>"file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv",<br/>"size": 36158371307,<br/>"container": "mkv",<br/>"videoProfile": "main 10"<br/>}<br/>]<br/>}<br/>] |
| `Genre` | [][operations.GetLibraryItemsGenre](../../models/operations/getlibraryitemsgenre.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"tag": "Adventure"<br/>}<br/>] |
| `Country` | [][operations.GetLibraryItemsCountry](../../models/operations/getlibraryitemscountry.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"tag": "United States of America"<br/>}<br/>] |
| `Director` | [][operations.GetLibraryItemsDirector](../../models/operations/getlibraryitemsdirector.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"tag": "James Cameron"<br/>}<br/>] |
| `Writer` | [][operations.GetLibraryItemsWriter](../../models/operations/getlibraryitemswriter.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"tag": "James Cameron"<br/>}<br/>] |
| `Role` | [][operations.GetLibraryItemsRole](../../models/operations/getlibraryitemsrole.md) | :heavy_minus_sign: | N/A | [<br/>{<br/>"tag": "Sigourney Weaver"<br/>}<br/>] |
| `TitleSort` | **string* | :heavy_minus_sign: | N/A | Whale |
| `ViewCount` | **int* | :heavy_minus_sign: | N/A | 1 |
| `LastViewedAt` | **int* | :heavy_minus_sign: | N/A | 1682752242 |
| `OriginalTitle` | **string* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 |
| `ViewOffset` | **int* | :heavy_minus_sign: | N/A | 5222500 |
| `SkipCount` | **int* | :heavy_minus_sign: | N/A | 1 |
| `Index` | **int* | :heavy_minus_sign: | N/A | 1 |
| `Theme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
| `LeafCount` | **int* | :heavy_minus_sign: | N/A | 14 |
| `ViewedLeafCount` | **int* | :heavy_minus_sign: | N/A | 0 |
| `ChildCount` | **int* | :heavy_minus_sign: | N/A | 1 |
| `HasPremiumExtras` | **string* | :heavy_minus_sign: | N/A | 1 |
| `HasPremiumPrimaryExtra` | **string* | :heavy_minus_sign: | N/A | 1 |
| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 66 |
| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | UCP |
| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Caprica |
| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 |
| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2010 |
| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `ParentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |

View File

@@ -1,14 +0,0 @@
# GetLibraryItemsPart
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ID` | **int* | :heavy_minus_sign: | N/A | 119542 |
| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/119542/1680457526/file.mkv |
| `Duration` | **int* | :heavy_minus_sign: | N/A | 11558112 |
| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
| `Size` | **int64* | :heavy_minus_sign: | N/A | 36158371307 |
| `Container` | **string* | :heavy_minus_sign: | N/A | mkv |
| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 |

View File

@@ -1,9 +0,0 @@
# GetLibraryItemsRequest
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `SectionID` | *int64* | :heavy_check_mark: | the Id of the library to query |
| `Tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. |

View File

@@ -1,11 +0,0 @@
# GetLibraryItemsResponse
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `Object` | [*operations.GetLibraryItemsResponseBody](../../models/operations/getlibraryitemsresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and tag |

View File

@@ -1,10 +0,0 @@
# GetLibraryItemsResponseBody
The contents of the library by section and tag
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `MediaContainer` | [*operations.GetLibraryItemsMediaContainer](../../models/operations/getlibraryitemsmediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -1,8 +0,0 @@
# GetLibraryItemsRole
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Tag` | **string* | :heavy_minus_sign: | N/A | Sigourney Weaver |

View File

@@ -1,8 +0,0 @@
# GetLibraryItemsWriter
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Tag` | **string* | :heavy_minus_sign: | N/A | James Cameron |

View File

@@ -3,6 +3,6 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |

View File

@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | | `Strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `XPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `XPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |

View File

@@ -3,6 +3,6 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | | `Timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |

View File

@@ -3,15 +3,15 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | | `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | 23409 |
| `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | | `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | /library/metadata/23409 |
| `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | | `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | playing |
| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | | `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 |
| `Time` | *float64* | :heavy_check_mark: | The time of the media item | | `Time` | *float64* | :heavy_check_mark: | The time of the media item | 2000 |
| `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | | `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | 10000 |
| `Context` | *string* | :heavy_check_mark: | The context of the media item | | `Context` | *string* | :heavy_check_mark: | The context of the media item | home:hub.continueWatching |
| `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | | `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | 1 |
| `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | | `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | 2000 |
| `Row` | *float64* | :heavy_check_mark: | The row of the media item | | `Row` | *float64* | :heavy_check_mark: | The row of the media item | 1 |

View File

@@ -3,6 +3,6 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |

View File

@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | | `PinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `XPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `XPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |

View File

@@ -3,21 +3,21 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | | `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | 1 |
| `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | | `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | /library/metadata/23409 |
| `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | | `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | 0 |
| `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | | `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | 0 |
| `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | | `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | hls |
| `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | | `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | 0 |
| `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | | `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | 0 |
| `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | | `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | 0 |
| `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | | `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | 100 |
| `Subtites` | **string* | :heavy_minus_sign: | The subtitles | | `Subtites` | **string* | :heavy_minus_sign: | The subtitles | burn |
| `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | | `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | 100 |
| `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | | `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | lan |
| `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | | `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | 102400 |
| `Session` | **string* | :heavy_minus_sign: | The session ID | | `Session` | **string* | :heavy_minus_sign: | The session ID | zvcage8b7rkioqcm8f4uns4c |
| `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | | `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | 0 |
| `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | | `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | 0 |

View File

@@ -1,28 +0,0 @@
# Tag
A key representing a specific tag within the section.
## Values
| Name | Value |
| ------------------- | ------------------- |
| `TagAll` | all |
| `TagUnwatched` | unwatched |
| `TagNewest` | newest |
| `TagRecentlyAdded` | recentlyAdded |
| `TagRecentlyViewed` | recentlyViewed |
| `TagOnDeck` | onDeck |
| `TagCollection` | collection |
| `TagEdition` | edition |
| `TagGenre` | genre |
| `TagYear` | year |
| `TagDecade` | decade |
| `TagDirector` | director |
| `TagActor` | actor |
| `TagCountry` | country |
| `TagContentRating` | contentRating |
| `TagRating` | rating |
| `TagResolution` | resolution |
| `TagFirstCharacter` | firstCharacter |
| `TagFolder` | folder |

View File

@@ -3,8 +3,8 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `Key` | *string* | :heavy_check_mark: | the media key | | `Key` | *string* | :heavy_check_mark: | the media key | |
| `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | | `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 |
| `State` | *string* | :heavy_check_mark: | The playback state of the media item. | | `State` | *string* | :heavy_check_mark: | The playback state of the media item. | played |

View File

@@ -36,9 +36,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Activities.GetServerActivities(ctx) res, err := s.Activities.GetServerActivities(ctx)
if err != nil { if err != nil {
@@ -84,12 +86,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var activityUUID string = "25b71ed5-0f9d-461c-baa7-d404e9e10d3e"
var activityUUID string = "<value>"
ctx := context.Background() ctx := context.Background()
res, err := s.Activities.CancelServerActivities(ctx, activityUUID) res, err := s.Activities.CancelServerActivities(ctx, activityUUID)
if err != nil { if err != nil {
@@ -103,10 +104,10 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | | `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |
### Response ### Response

View File

@@ -32,14 +32,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation
var scope operations.Scope = operations.ScopeAll var scope operations.Scope = operations.ScopeAll
ctx := context.Background() ctx := context.Background()
res, err := s.Authentication.GetTransientToken(ctx, type_, scope) res, err := s.Authentication.GetTransientToken(ctx, type_, scope)
if err != nil { if err != nil {
@@ -89,12 +88,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var source string = "server://client-identifier" var source string = "server://client-identifier"
ctx := context.Background() ctx := context.Background()
res, err := s.Authentication.GetSourceConnectionInformation(ctx, source) res, err := s.Authentication.GetSourceConnectionInformation(ctx, source)
if err != nil { if err != nil {

View File

@@ -33,9 +33,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Butler.GetButlerTasks(ctx) res, err := s.Butler.GetButlerTasks(ctx)
if err != nil { if err != nil {
@@ -86,9 +88,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Butler.StartAllTasks(ctx) res, err := s.Butler.StartAllTasks(ctx)
if err != nil { if err != nil {
@@ -135,9 +139,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Butler.StopAllTasks(ctx) res, err := s.Butler.StopAllTasks(ctx)
if err != nil { if err != nil {
@@ -189,12 +195,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var taskName operations.TaskName = operations.TaskNameCleanOldBundles var taskName operations.TaskName = operations.TaskNameCleanOldBundles
ctx := context.Background() ctx := context.Background()
res, err := s.Butler.StartTask(ctx, taskName) res, err := s.Butler.StartTask(ctx, taskName)
if err != nil { if err != nil {
@@ -243,12 +248,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase
ctx := context.Background() ctx := context.Background()
res, err := s.Butler.StopTask(ctx, taskName) res, err := s.Butler.StopTask(ctx, taskName)
if err != nil { if err != nil {

View File

@@ -31,14 +31,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var count *float64 = plexgo.Float64(1262.49) var count *float64 = plexgo.Float64(1262.49)
var onlyTransient *operations.OnlyTransient = operations.OnlyTransientOne.ToPointer() var onlyTransient *operations.OnlyTransient = operations.OnlyTransientOne.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Hubs.GetGlobalHubs(ctx, count, onlyTransient) res, err := s.Hubs.GetGlobalHubs(ctx, count, onlyTransient)
if err != nil { if err != nil {
@@ -88,16 +87,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sectionID float64 = 6728.76 var sectionID float64 = 6728.76
var count *float64 = plexgo.Float64(9010.22) var count *float64 = plexgo.Float64(9010.22)
var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero.ToPointer() var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Hubs.GetLibraryHubs(ctx, sectionID, count, onlyTransient) res, err := s.Hubs.GetLibraryHubs(ctx, sectionID, count, onlyTransient)
if err != nil { if err != nil {

View File

@@ -13,7 +13,6 @@ API Calls interacting with Plex Media Server Libraries
* [GetLibraries](#getlibraries) - Get All Libraries * [GetLibraries](#getlibraries) - Get All Libraries
* [GetLibrary](#getlibrary) - Get Library Details * [GetLibrary](#getlibrary) - Get Library Details
* [DeleteLibrary](#deletelibrary) - Delete Library Section * [DeleteLibrary](#deletelibrary) - Delete Library Section
* [GetLibraryItems](#getlibraryitems) - Get Library Items
* [RefreshLibrary](#refreshlibrary) - Refresh Library * [RefreshLibrary](#refreshlibrary) - Refresh Library
* [SearchLibrary](#searchlibrary) - Search Library * [SearchLibrary](#searchlibrary) - Search Library
* [GetMetadata](#getmetadata) - Get Items Metadata * [GetMetadata](#getmetadata) - Get Items Metadata
@@ -39,14 +38,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var url_ string = "file://C:\Image.png&type=13" var url_ string = "file://C:\Image.png&type=13"
var type_ *float64 = plexgo.Float64(4462.17) var type_ *float64 = plexgo.Float64(4462.17)
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetFileHash(ctx, url_, type_) res, err := s.Library.GetFileHash(ctx, url_, type_)
if err != nil { if err != nil {
@@ -95,9 +93,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetRecentlyAdded(ctx) res, err := s.Library.GetRecentlyAdded(ctx)
if err != nil { if err != nil {
@@ -149,9 +149,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetLibraries(ctx) res, err := s.Library.GetLibraries(ctx)
if err != nil { if err != nil {
@@ -237,14 +239,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sectionID float64 = 1000 var sectionID float64 = 1000
var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer() var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetLibrary(ctx, sectionID, includeDetails) res, err := s.Library.GetLibrary(ctx, sectionID, includeDetails)
if err != nil { if err != nil {
@@ -292,12 +293,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sectionID float64 = 1000 var sectionID float64 = 1000
ctx := context.Background() ctx := context.Background()
res, err := s.Library.DeleteLibrary(ctx, sectionID) res, err := s.Library.DeleteLibrary(ctx, sectionID)
if err != nil { if err != nil {
@@ -325,81 +325,6 @@ func main() {
| sdkerrors.DeleteLibraryResponseBody | 401 | application/json | | sdkerrors.DeleteLibraryResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | */* | | sdkerrors.SDKError | 4xx-5xx | */* |
## GetLibraryItems
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
- `all`: All items in the section.
- `unwatched`: Items that have not been played.
- `newest`: Items that are recently released.
- `recentlyAdded`: Items that are recently added to the library.
- `recentlyViewed`: Items that were recently viewed.
- `onDeck`: Items to continue watching.
- `collection`: Items categorized by collection.
- `edition`: Items categorized by edition.
- `genre`: Items categorized by genre.
- `year`: Items categorized by year of release.
- `decade`: Items categorized by decade.
- `director`: Items categorized by director.
- `actor`: Items categorized by starring actor.
- `country`: Items categorized by country of origin.
- `contentRating`: Items categorized by content rating.
- `rating`: Items categorized by rating.
- `resolution`: Items categorized by resolution.
- `firstCharacter`: Items categorized by the first letter.
- `folder`: Items categorized by folder.
### Example Usage
```go
package main
import(
"github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"context"
"log"
)
func main() {
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"),
)
var sectionID int64 = 451092
var tag operations.Tag = operations.TagUnwatched
ctx := context.Background()
res, err := s.Library.GetLibraryItems(ctx, sectionID, tag)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `sectionID` | *int64* | :heavy_check_mark: | the Id of the library to query |
| `tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. |
### Response
**[*operations.GetLibraryItemsResponse](../../models/operations/getlibraryitemsresponse.md), error**
| Error Object | Status Code | Content Type |
| ------------------ | ------------------ | ------------------ |
| sdkerrors.SDKError | 4xx-5xx | */* |
## RefreshLibrary ## RefreshLibrary
This endpoint Refreshes the library. This endpoint Refreshes the library.
@@ -420,12 +345,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sectionID float64 = 934.16 var sectionID float64 = 934.16
ctx := context.Background() ctx := context.Background()
res, err := s.Library.RefreshLibrary(ctx, sectionID) res, err := s.Library.RefreshLibrary(ctx, sectionID)
if err != nil { if err != nil {
@@ -491,14 +415,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sectionID int64 = 933505 var sectionID int64 = 933505
var type_ operations.Type = operations.TypeFour var type_ operations.Type = operations.TypeFour
ctx := context.Background() ctx := context.Background()
res, err := s.Library.SearchLibrary(ctx, sectionID, type_) res, err := s.Library.SearchLibrary(ctx, sectionID, type_)
if err != nil { if err != nil {
@@ -546,12 +469,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var ratingKey float64 = 8382.31 var ratingKey float64 = 8382.31
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetMetadata(ctx, ratingKey) res, err := s.Library.GetMetadata(ctx, ratingKey)
if err != nil { if err != nil {
@@ -599,12 +521,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var ratingKey float64 = 1539.14 var ratingKey float64 = 1539.14
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetMetadataChildren(ctx, ratingKey) res, err := s.Library.GetMetadataChildren(ctx, ratingKey)
if err != nil { if err != nil {
@@ -652,9 +573,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Library.GetOnDeck(ctx) res, err := s.Library.GetOnDeck(ctx)
if err != nil { if err != nil {

View File

@@ -33,16 +33,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var level operations.Level = operations.LevelThree var level operations.Level = operations.LevelThree
var message string = "Test log message" var message string = "Test log message"
var source string = "Postman" var source string = "Postman"
ctx := context.Background() ctx := context.Background()
res, err := s.Log.LogLine(ctx, level, message, source) res, err := s.Log.LogLine(ctx, level, message, source)
if err != nil { if err != nil {
@@ -112,13 +111,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() var request string = "level=4&message=Test%20message%201&source=postman
res, err := s.Log.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman
level=3&message=Test%20message%202&source=postman level=3&message=Test%20message%202&source=postman
level=1&message=Test%20message%203&source=postman") level=1&message=Test%20message%203&source=postman"
ctx := context.Background()
res, err := s.Log.LogMultiLine(ctx, request)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -164,9 +165,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Log.EnablePaperTrail(ctx) res, err := s.Log.EnablePaperTrail(ctx)
if err != nil { if err != nil {

View File

@@ -31,12 +31,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var key float64 = 59398 var key float64 = 59398
ctx := context.Background() ctx := context.Background()
res, err := s.Media.MarkPlayed(ctx, key) res, err := s.Media.MarkPlayed(ctx, key)
if err != nil { if err != nil {
@@ -83,12 +82,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var key float64 = 59398 var key float64 = 59398
ctx := context.Background() ctx := context.Background()
res, err := s.Media.MarkUnplayed(ctx, key) res, err := s.Media.MarkUnplayed(ctx, key)
if err != nil { if err != nil {
@@ -136,16 +134,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var key string = "<value>" var key string = "<value>"
var time float64 = 6900.91 var time float64 = 90000
var state string = "<value>"
var state string = "played"
ctx := context.Background() ctx := context.Background()
res, err := s.Media.UpdatePlayProgress(ctx, key, time, state) res, err := s.Media.UpdatePlayProgress(ctx, key, time, state)
if err != nil { if err != nil {
@@ -159,12 +156,12 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `key` | *string* | :heavy_check_mark: | the media key | | `key` | *string* | :heavy_check_mark: | the media key | |
| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | | `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 |
| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | | `state` | *string* | :heavy_check_mark: | The playback state of the media item. | played |
### Response ### Response

View File

@@ -36,24 +36,26 @@ package main
import( import(
"github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/operations"
"context"
"log" "log"
) )
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() request := operations.CreatePlaylistRequest{
res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{
Title: "<value>", Title: "<value>",
Type: operations.QueryParamTypePhoto, Type: operations.QueryParamTypePhoto,
Smart: operations.SmartOne, Smart: operations.SmartOne,
URI: "https://inborn-brochure.biz", URI: "https://inborn-brochure.biz",
}) }
ctx := context.Background()
res, err := s.Playlists.CreatePlaylist(ctx, request)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -99,14 +101,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio.ToPointer() var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio.ToPointer()
var smart *operations.QueryParamSmart = operations.QueryParamSmartZero.ToPointer() var smart *operations.QueryParamSmart = operations.QueryParamSmartZero.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.GetPlaylists(ctx, playlistType, smart) res, err := s.Playlists.GetPlaylists(ctx, playlistType, smart)
if err != nil { if err != nil {
@@ -156,12 +157,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 4109.48 var playlistID float64 = 4109.48
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.GetPlaylist(ctx, playlistID) res, err := s.Playlists.GetPlaylist(ctx, playlistID)
if err != nil { if err != nil {
@@ -209,12 +209,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 216.22 var playlistID float64 = 216.22
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.DeletePlaylist(ctx, playlistID) res, err := s.Playlists.DeletePlaylist(ctx, playlistID)
if err != nil { if err != nil {
@@ -262,16 +261,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 3915 var playlistID float64 = 3915
var title *string = plexgo.String("<value>") var title *string = plexgo.String("<value>")
var summary *string = plexgo.String("<value>") var summary *string = plexgo.String("<value>")
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.UpdatePlaylist(ctx, playlistID, title, summary) res, err := s.Playlists.UpdatePlaylist(ctx, playlistID, title, summary)
if err != nil { if err != nil {
@@ -324,14 +322,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 5004.46 var playlistID float64 = 5004.46
var type_ float64 = 9403.59 var type_ float64 = 9403.59
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.GetPlaylistContents(ctx, playlistID, type_) res, err := s.Playlists.GetPlaylistContents(ctx, playlistID, type_)
if err != nil { if err != nil {
@@ -380,12 +377,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 1893.18 var playlistID float64 = 1893.18
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.ClearPlaylistContents(ctx, playlistID) res, err := s.Playlists.ClearPlaylistContents(ctx, playlistID)
if err != nil { if err != nil {
@@ -434,16 +430,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var playlistID float64 = 8502.01 var playlistID float64 = 8502.01
var uri string = "server://12345/com.plexapp.plugins.library/library/metadata/1" var uri string = "server://12345/com.plexapp.plugins.library/library/metadata/1"
var playQueueID *float64 = plexgo.Float64(123) var playQueueID *float64 = plexgo.Float64(123)
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.AddPlaylistContents(ctx, playlistID, uri, playQueueID) res, err := s.Playlists.AddPlaylistContents(ctx, playlistID, uri, playQueueID)
if err != nil { if err != nil {
@@ -494,14 +489,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var path string = "/home/barkley/playlist.m3u" var path string = "/home/barkley/playlist.m3u"
var force operations.Force = operations.ForceZero var force operations.Force = operations.ForceZero
ctx := context.Background() ctx := context.Background()
res, err := s.Playlists.UploadPlaylist(ctx, path, force) res, err := s.Playlists.UploadPlaylist(ctx, path, force)
if err != nil { if err != nil {

View File

@@ -28,14 +28,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var strong *bool = plexgo.Bool(false) var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>") var xPlexClientIdentifier *string = plexgo.String("Postman")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier) res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier)
if err != nil { if err != nil {
@@ -49,12 +48,12 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | | `strong` | **bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `xPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `xPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
### Response ### Response
@@ -82,14 +81,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var pinID string = "<value>" var pinID string = "<value>"
var xPlexClientIdentifier *string = plexgo.String("<value>") var xPlexClientIdentifier *string = plexgo.String("Postman")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetToken(ctx, pinID, xPlexClientIdentifier) res, err := s.Plex.GetToken(ctx, pinID, xPlexClientIdentifier)
if err != nil { if err != nil {
@@ -103,12 +101,12 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | | `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `xPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | | `xPlexClientIdentifier` | **string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | Postman |
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | |
### Response ### Response

View File

@@ -43,16 +43,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var query string = "dylan" var query string = "dylan"
var sectionID *float64 = plexgo.Float64(1516.53) var sectionID *float64 = plexgo.Float64(1516.53)
var limit *float64 = plexgo.Float64(5) var limit *float64 = plexgo.Float64(5)
ctx := context.Background() ctx := context.Background()
res, err := s.Search.PerformSearch(ctx, query, sectionID, limit) res, err := s.Search.PerformSearch(ctx, query, sectionID, limit)
if err != nil { if err != nil {
@@ -105,16 +104,15 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var query string = "dead+poop" var query string = "dead+poop"
var sectionID *float64 = plexgo.Float64(4094.8) var sectionID *float64 = plexgo.Float64(4094.8)
var limit *float64 = plexgo.Float64(5) var limit *float64 = plexgo.Float64(5)
ctx := context.Background() ctx := context.Background()
res, err := s.Search.PerformVoiceSearch(ctx, query, sectionID, limit) res, err := s.Search.PerformVoiceSearch(ctx, query, sectionID, limit)
if err != nil { if err != nil {
@@ -163,12 +161,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var query string = "110" var query string = "110"
ctx := context.Background() ctx := context.Background()
res, err := s.Search.GetSearchResults(ctx, query) res, err := s.Search.GetSearchResults(ctx, query)
if err != nil { if err != nil {

View File

@@ -36,9 +36,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetServerCapabilities(ctx) res, err := s.Server.GetServerCapabilities(ctx)
if err != nil { if err != nil {
@@ -84,9 +86,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetServerPreferences(ctx) res, err := s.Server.GetServerPreferences(ctx)
if err != nil { if err != nil {
@@ -132,9 +136,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetAvailableClients(ctx) res, err := s.Server.GetAvailableClients(ctx)
if err != nil { if err != nil {
@@ -180,9 +186,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetDevices(ctx) res, err := s.Server.GetDevices(ctx)
if err != nil { if err != nil {
@@ -228,9 +236,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetServerIdentity(ctx) res, err := s.Server.GetServerIdentity(ctx)
if err != nil { if err != nil {
@@ -276,9 +286,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetMyPlexAccount(ctx) res, err := s.Server.GetMyPlexAccount(ctx)
if err != nil { if err != nil {
@@ -318,19 +330,18 @@ package main
import( import(
"github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/operations"
"context"
"log" "log"
) )
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() request := operations.GetResizedPhotoRequest{
res, err := s.Server.GetResizedPhoto(ctx, operations.GetResizedPhotoRequest{
Width: 110, Width: 110,
Height: 165, Height: 165,
Opacity: 100, Opacity: 100,
@@ -338,7 +349,10 @@ func main() {
MinSize: operations.MinSizeOne, MinSize: operations.MinSizeOne,
Upscale: operations.UpscaleZero, Upscale: operations.UpscaleZero,
URL: "/library/metadata/49564/thumb/1654258204", URL: "/library/metadata/49564/thumb/1654258204",
}) }
ctx := context.Background()
res, err := s.Server.GetResizedPhoto(ctx, request)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -383,9 +397,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Server.GetServerList(ctx) res, err := s.Server.GetServerList(ctx)
if err != nil { if err != nil {

View File

@@ -32,9 +32,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Sessions.GetSessions(ctx) res, err := s.Sessions.GetSessions(ctx)
if err != nil { if err != nil {
@@ -80,9 +82,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Sessions.GetSessionHistory(ctx) res, err := s.Sessions.GetSessionHistory(ctx)
if err != nil { if err != nil {
@@ -128,9 +132,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Sessions.GetTranscodeSessions(ctx) res, err := s.Sessions.GetTranscodeSessions(ctx)
if err != nil { if err != nil {
@@ -176,12 +182,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var sessionKey string = "zz7llzqlx8w9vnrsbnwhbmep" var sessionKey string = "zz7llzqlx8w9vnrsbnwhbmep"
ctx := context.Background() ctx := context.Background()
res, err := s.Sessions.StopTranscodeSession(ctx, sessionKey) res, err := s.Sessions.StopTranscodeSession(ctx, sessionKey)
if err != nil { if err != nil {

View File

@@ -29,12 +29,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var timespan *int64 = plexgo.Int64(4)
var timespan *int64 = plexgo.Int64(411769)
ctx := context.Background() ctx := context.Background()
res, err := s.Statistics.GetStatistics(ctx, timespan) res, err := s.Statistics.GetStatistics(ctx, timespan)
if err != nil { if err != nil {
@@ -48,10 +47,10 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | | `timespan` | **int64* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> | 4 |
### Response ### Response

View File

@@ -32,9 +32,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
ctx := context.Background() ctx := context.Background()
res, err := s.Updater.GetUpdateStatus(ctx) res, err := s.Updater.GetUpdateStatus(ctx)
if err != nil { if err != nil {
@@ -81,12 +83,11 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var download *operations.Download = operations.DownloadOne.ToPointer() var download *operations.Download = operations.DownloadOne.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Updater.CheckForUpdates(ctx, download) res, err := s.Updater.CheckForUpdates(ctx, download)
if err != nil { if err != nil {
@@ -100,10 +101,10 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | | `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |
### Response ### Response
@@ -135,14 +136,13 @@ import(
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
var tonight *operations.Tonight = operations.TonightOne.ToPointer() var tonight *operations.Tonight = operations.TonightOne.ToPointer()
var skip *operations.Skip = operations.SkipZero.ToPointer() var skip *operations.Skip = operations.SkipOne.ToPointer()
ctx := context.Background() ctx := context.Background()
res, err := s.Updater.ApplyUpdates(ctx, tonight, skip) res, err := s.Updater.ApplyUpdates(ctx, tonight, skip)
if err != nil { if err != nil {
@@ -156,11 +156,11 @@ func main() {
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | | `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | | `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | 1 |
### Response ### Response

View File

@@ -23,30 +23,32 @@ package main
import( import(
"github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/operations"
"context"
"log" "log"
) )
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
request := operations.GetTimelineRequest{
RatingKey: 23409,
Key: "/library/metadata/23409",
State: operations.StatePlaying,
HasMDE: 1,
Time: 2000,
Duration: 10000,
Context: "home:hub.continueWatching",
PlayQueueItemID: 1,
PlayBackTime: 2000,
Row: 1,
}
ctx := context.Background() ctx := context.Background()
res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{ res, err := s.Video.GetTimeline(ctx, request)
RatingKey: 716.56,
Key: "<key>",
State: operations.StatePaused,
HasMDE: 7574.33,
Time: 3327.51,
Duration: 7585.39,
Context: "<value>",
PlayQueueItemID: 1406.21,
PlayBackTime: 2699.34,
Row: 3536.42,
})
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -84,25 +86,38 @@ package main
import( import(
"github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations" "github.com/LukeHagar/plexgo/models/operations"
"context"
"log" "log"
) )
func main() { func main() {
s := plexgo.New( s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"), plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("<value>"), plexgo.WithXPlexClientIdentifier("Postman"),
) )
request := operations.StartUniversalTranscodeRequest{
HasMDE: 1,
Path: "/library/metadata/23409",
MediaIndex: 0,
PartIndex: 0,
Protocol: "hls",
FastSeek: plexgo.Float64(0),
DirectPlay: plexgo.Float64(0),
DirectStream: plexgo.Float64(0),
SubtitleSize: plexgo.Float64(100),
Subtites: plexgo.String("burn"),
AudioBoost: plexgo.Float64(100),
Location: plexgo.String("lan"),
MediaBufferSize: plexgo.Float64(102400),
Session: plexgo.String("zvcage8b7rkioqcm8f4uns4c"),
AddDebugOverlay: plexgo.Float64(0),
AutoAdjustQuality: plexgo.Float64(0),
}
ctx := context.Background() ctx := context.Background()
res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ res, err := s.Video.StartUniversalTranscode(ctx, request)
HasMDE: 8924.99,
Path: "/etc/mail",
MediaIndex: 9962.95,
PartIndex: 1232.82,
Protocol: "<value>",
})
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@@ -78,9 +78,11 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -194,9 +196,11 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -8,6 +8,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"reflect" "reflect"
"strconv"
"strings" "strings"
"time" "time"
"unsafe" "unsafe"
@@ -260,6 +261,18 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error)
typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v))
switch typ.Kind() { switch typ.Kind() {
case reflect.Int64:
format := tag.Get("integer")
if format == "string" {
b := val.Interface().(int64)
return []byte(fmt.Sprintf(`"%d"`, b)), nil
}
case reflect.Float64:
format := tag.Get("number")
if format == "string" {
b := val.Interface().(float64)
return []byte(fmt.Sprintf(`"%g"`, b)), nil
}
case reflect.Map: case reflect.Map:
if isNil(typ, val) { if isNil(typ, val) {
return []byte("null"), nil return []byte("null"), nil
@@ -349,6 +362,16 @@ func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.Struc
if bigIntTag == "string" { if bigIntTag == "string" {
return []byte(fmt.Sprintf(`"%s"`, tagValue)) return []byte(fmt.Sprintf(`"%s"`, tagValue))
} }
case reflect.TypeOf(int64(0)):
format := tag.Get("integer")
if format == "string" {
return []byte(fmt.Sprintf(`"%s"`, tagValue))
}
case reflect.TypeOf(float64(0)):
format := tag.Get("number")
if format == "string" {
return []byte(fmt.Sprintf(`"%s"`, tagValue))
}
case reflect.TypeOf(decimal.Big{}): case reflect.TypeOf(decimal.Big{}):
decimalTag := tag.Get("decimal") decimalTag := tag.Get("decimal")
if decimalTag != "number" { if decimalTag != "number" {
@@ -377,6 +400,57 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa
typ := dereferenceTypePointer(v.Type()) typ := dereferenceTypePointer(v.Type())
switch typ.Kind() { switch typ.Kind() {
case reflect.Int64:
var b int64
format := tag.Get("integer")
if format == "string" {
var s string
if err := json.Unmarshal(value, &s); err != nil {
return err
}
var err error
b, err = strconv.ParseInt(s, 10, 64)
if err != nil {
return fmt.Errorf("failed to parse string as int64: %w", err)
}
if v.Kind() == reflect.Ptr {
if v.IsNil() {
v.Set(reflect.New(typ))
}
v = v.Elem()
}
v.Set(reflect.ValueOf(b))
return nil
}
case reflect.Float64:
var b float64
format := tag.Get("number")
if format == "string" {
var s string
if err := json.Unmarshal(value, &s); err != nil {
return err
}
var err error
b, err = strconv.ParseFloat(s, 64)
if err != nil {
return fmt.Errorf("failed to parse string as float64: %w", err)
}
if v.Kind() == reflect.Ptr {
if v.IsNil() {
v.Set(reflect.New(typ))
}
v = v.Elem()
}
v.Set(reflect.ValueOf(b))
return nil
}
case reflect.Map: case reflect.Map:
if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) {
if v.CanAddr() { if v.CanAddr() {

View File

@@ -78,9 +78,11 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -173,9 +175,11 @@ func (s *Library) GetRecentlyAdded(ctx context.Context) (*operations.GetRecently
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -284,9 +288,11 @@ func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesRes
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -437,9 +443,11 @@ func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDeta
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -547,9 +555,11 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operat
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -599,121 +609,6 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operat
return res, nil return res, nil
} }
// GetLibraryItems - Get Library Items
// Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
// - `all`: All items in the section.
// - `unwatched`: Items that have not been played.
// - `newest`: Items that are recently released.
// - `recentlyAdded`: Items that are recently added to the library.
// - `recentlyViewed`: Items that were recently viewed.
// - `onDeck`: Items to continue watching.
// - `collection`: Items categorized by collection.
// - `edition`: Items categorized by edition.
// - `genre`: Items categorized by genre.
// - `year`: Items categorized by year of release.
// - `decade`: Items categorized by decade.
// - `director`: Items categorized by director.
// - `actor`: Items categorized by starring actor.
// - `country`: Items categorized by country of origin.
// - `contentRating`: Items categorized by content rating.
// - `rating`: Items categorized by rating.
// - `resolution`: Items categorized by resolution.
// - `firstCharacter`: Items categorized by the first letter.
// - `folder`: Items categorized by folder.
func (s *Library) GetLibraryItems(ctx context.Context, sectionID int64, tag operations.Tag) (*operations.GetLibraryItemsResponse, error) {
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getLibraryItems",
OAuth2Scopes: []string{},
SecuritySource: s.sdkConfiguration.Security,
}
request := operations.GetLibraryItemsRequest{
SectionID: sectionID,
Tag: tag,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/{tag}", request, nil)
if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err)
}
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
if err != nil {
return nil, fmt.Errorf("error creating request: %w", err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
return nil, err
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
httpRes, err := s.sdkConfiguration.Client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
err = fmt.Errorf("error sending request: %w", err)
} else {
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
}
res := &operations.GetLibraryItemsResponse{
StatusCode: httpRes.StatusCode,
ContentType: httpRes.Header.Get("Content-Type"),
RawResponse: httpRes,
}
rawBody, err := io.ReadAll(httpRes.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}
httpRes.Body.Close()
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out operations.GetLibraryItemsResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
res.Object = &out
default:
return 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 && httpRes.StatusCode < 600:
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
default:
return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}
return res, nil
}
// RefreshLibrary - Refresh Library // RefreshLibrary - Refresh Library
// This endpoint Refreshes the library. // This endpoint Refreshes the library.
func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*operations.RefreshLibraryResponse, error) { func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*operations.RefreshLibraryResponse, error) {
@@ -761,9 +656,11 @@ func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*opera
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -882,9 +779,11 @@ func (s *Library) SearchLibrary(ctx context.Context, sectionID int64, type_ oper
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -977,9 +876,11 @@ func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operatio
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -1087,9 +988,11 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64) (*
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -1193,9 +1096,11 @@ func (s *Library) GetOnDeck(ctx context.Context) (*operations.GetOnDeckResponse,
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

12
log.go
View File

@@ -79,9 +79,11 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -200,9 +202,11 @@ func (s *Log) LogMultiLine(ctx context.Context, request string) (*operations.Log
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -295,9 +299,11 @@ func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrai
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -77,9 +77,11 @@ func (s *Media) MarkPlayed(ctx context.Context, key float64) (*operations.MarkPl
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -180,9 +182,11 @@ func (s *Media) MarkUnplayed(ctx context.Context, key float64) (*operations.Mark
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -285,9 +289,11 @@ func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -1,992 +0,0 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"github.com/LukeHagar/plexgo/internal/utils"
"github.com/LukeHagar/plexgo/types"
"net/http"
)
// Tag - A key representing a specific tag within the section.
type Tag string
const (
TagAll Tag = "all"
TagUnwatched Tag = "unwatched"
TagNewest Tag = "newest"
TagRecentlyAdded Tag = "recentlyAdded"
TagRecentlyViewed Tag = "recentlyViewed"
TagOnDeck Tag = "onDeck"
TagCollection Tag = "collection"
TagEdition Tag = "edition"
TagGenre Tag = "genre"
TagYear Tag = "year"
TagDecade Tag = "decade"
TagDirector Tag = "director"
TagActor Tag = "actor"
TagCountry Tag = "country"
TagContentRating Tag = "contentRating"
TagRating Tag = "rating"
TagResolution Tag = "resolution"
TagFirstCharacter Tag = "firstCharacter"
TagFolder Tag = "folder"
)
func (e Tag) ToPointer() *Tag {
return &e
}
func (e *Tag) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "all":
fallthrough
case "unwatched":
fallthrough
case "newest":
fallthrough
case "recentlyAdded":
fallthrough
case "recentlyViewed":
fallthrough
case "onDeck":
fallthrough
case "collection":
fallthrough
case "edition":
fallthrough
case "genre":
fallthrough
case "year":
fallthrough
case "decade":
fallthrough
case "director":
fallthrough
case "actor":
fallthrough
case "country":
fallthrough
case "contentRating":
fallthrough
case "rating":
fallthrough
case "resolution":
fallthrough
case "firstCharacter":
fallthrough
case "folder":
*e = Tag(v)
return nil
default:
return fmt.Errorf("invalid value for Tag: %v", v)
}
}
type GetLibraryItemsRequest struct {
// the Id of the library to query
SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"`
// A key representing a specific tag within the section.
Tag Tag `pathParam:"style=simple,explode=false,name=tag"`
}
func (o *GetLibraryItemsRequest) GetSectionID() int64 {
if o == nil {
return 0
}
return o.SectionID
}
func (o *GetLibraryItemsRequest) GetTag() Tag {
if o == nil {
return Tag("")
}
return o.Tag
}
type GetLibraryItemsPart struct {
ID *int `json:"id,omitempty"`
Key *string `json:"key,omitempty"`
Duration *int `json:"duration,omitempty"`
File *string `json:"file,omitempty"`
Size *int64 `json:"size,omitempty"`
Container *string `json:"container,omitempty"`
VideoProfile *string `json:"videoProfile,omitempty"`
}
func (o *GetLibraryItemsPart) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetLibraryItemsPart) GetKey() *string {
if o == nil {
return nil
}
return o.Key
}
func (o *GetLibraryItemsPart) GetDuration() *int {
if o == nil {
return nil
}
return o.Duration
}
func (o *GetLibraryItemsPart) GetFile() *string {
if o == nil {
return nil
}
return o.File
}
func (o *GetLibraryItemsPart) GetSize() *int64 {
if o == nil {
return nil
}
return o.Size
}
func (o *GetLibraryItemsPart) GetContainer() *string {
if o == nil {
return nil
}
return o.Container
}
func (o *GetLibraryItemsPart) GetVideoProfile() *string {
if o == nil {
return nil
}
return o.VideoProfile
}
type GetLibraryItemsMedia struct {
ID *int `json:"id,omitempty"`
Duration *int `json:"duration,omitempty"`
Bitrate *int `json:"bitrate,omitempty"`
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
AspectRatio *float64 `json:"aspectRatio,omitempty"`
AudioChannels *int `json:"audioChannels,omitempty"`
AudioCodec *string `json:"audioCodec,omitempty"`
VideoCodec *string `json:"videoCodec,omitempty"`
VideoResolution *string `json:"videoResolution,omitempty"`
Container *string `json:"container,omitempty"`
VideoFrameRate *string `json:"videoFrameRate,omitempty"`
VideoProfile *string `json:"videoProfile,omitempty"`
Part []GetLibraryItemsPart `json:"Part,omitempty"`
}
func (o *GetLibraryItemsMedia) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetLibraryItemsMedia) GetDuration() *int {
if o == nil {
return nil
}
return o.Duration
}
func (o *GetLibraryItemsMedia) GetBitrate() *int {
if o == nil {
return nil
}
return o.Bitrate
}
func (o *GetLibraryItemsMedia) GetWidth() *int {
if o == nil {
return nil
}
return o.Width
}
func (o *GetLibraryItemsMedia) GetHeight() *int {
if o == nil {
return nil
}
return o.Height
}
func (o *GetLibraryItemsMedia) GetAspectRatio() *float64 {
if o == nil {
return nil
}
return o.AspectRatio
}
func (o *GetLibraryItemsMedia) GetAudioChannels() *int {
if o == nil {
return nil
}
return o.AudioChannels
}
func (o *GetLibraryItemsMedia) GetAudioCodec() *string {
if o == nil {
return nil
}
return o.AudioCodec
}
func (o *GetLibraryItemsMedia) GetVideoCodec() *string {
if o == nil {
return nil
}
return o.VideoCodec
}
func (o *GetLibraryItemsMedia) GetVideoResolution() *string {
if o == nil {
return nil
}
return o.VideoResolution
}
func (o *GetLibraryItemsMedia) GetContainer() *string {
if o == nil {
return nil
}
return o.Container
}
func (o *GetLibraryItemsMedia) GetVideoFrameRate() *string {
if o == nil {
return nil
}
return o.VideoFrameRate
}
func (o *GetLibraryItemsMedia) GetVideoProfile() *string {
if o == nil {
return nil
}
return o.VideoProfile
}
func (o *GetLibraryItemsMedia) GetPart() []GetLibraryItemsPart {
if o == nil {
return nil
}
return o.Part
}
type GetLibraryItemsGenre struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsGenre) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsCountry struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsCountry) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsDirector struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsDirector) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsWriter struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsWriter) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsRole struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsRole) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsMetadata struct {
RatingKey *string `json:"ratingKey,omitempty"`
Key *string `json:"key,omitempty"`
GUID *string `json:"guid,omitempty"`
Studio *string `json:"studio,omitempty"`
Type *string `json:"type,omitempty"`
Title *string `json:"title,omitempty"`
ContentRating *string `json:"contentRating,omitempty"`
Summary *string `json:"summary,omitempty"`
Rating *float64 `json:"rating,omitempty"`
AudienceRating *float64 `json:"audienceRating,omitempty"`
Year *int `json:"year,omitempty"`
Tagline *string `json:"tagline,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Art *string `json:"art,omitempty"`
Duration *int `json:"duration,omitempty"`
OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"`
AddedAt *int `json:"addedAt,omitempty"`
UpdatedAt *int `json:"updatedAt,omitempty"`
AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
ChapterSource *string `json:"chapterSource,omitempty"`
PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"`
RatingImage *string `json:"ratingImage,omitempty"`
GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"`
GrandparentGUID *string `json:"grandparentGuid,omitempty"`
GrandparentKey *string `json:"grandparentKey,omitempty"`
GrandparentTitle *string `json:"grandparentTitle,omitempty"`
GrandparentThumb *string `json:"grandparentThumb,omitempty"`
GrandparentArt *string `json:"grandparentArt,omitempty"`
GrandparentTheme *string `json:"grandparentTheme,omitempty"`
Media []GetLibraryItemsMedia `json:"Media,omitempty"`
Genre []GetLibraryItemsGenre `json:"Genre,omitempty"`
Country []GetLibraryItemsCountry `json:"Country,omitempty"`
Director []GetLibraryItemsDirector `json:"Director,omitempty"`
Writer []GetLibraryItemsWriter `json:"Writer,omitempty"`
Role []GetLibraryItemsRole `json:"Role,omitempty"`
TitleSort *string `json:"titleSort,omitempty"`
ViewCount *int `json:"viewCount,omitempty"`
LastViewedAt *int `json:"lastViewedAt,omitempty"`
OriginalTitle *string `json:"originalTitle,omitempty"`
ViewOffset *int `json:"viewOffset,omitempty"`
SkipCount *int `json:"skipCount,omitempty"`
Index *int `json:"index,omitempty"`
Theme *string `json:"theme,omitempty"`
LeafCount *int `json:"leafCount,omitempty"`
ViewedLeafCount *int `json:"viewedLeafCount,omitempty"`
ChildCount *int `json:"childCount,omitempty"`
HasPremiumExtras *string `json:"hasPremiumExtras,omitempty"`
HasPremiumPrimaryExtra *string `json:"hasPremiumPrimaryExtra,omitempty"`
ParentRatingKey *string `json:"parentRatingKey,omitempty"`
ParentGUID *string `json:"parentGuid,omitempty"`
ParentStudio *string `json:"parentStudio,omitempty"`
ParentKey *string `json:"parentKey,omitempty"`
ParentTitle *string `json:"parentTitle,omitempty"`
ParentIndex *int `json:"parentIndex,omitempty"`
ParentYear *int `json:"parentYear,omitempty"`
ParentThumb *string `json:"parentThumb,omitempty"`
ParentTheme *string `json:"parentTheme,omitempty"`
}
func (g GetLibraryItemsMetadata) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetLibraryItemsMetadata) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetLibraryItemsMetadata) GetRatingKey() *string {
if o == nil {
return nil
}
return o.RatingKey
}
func (o *GetLibraryItemsMetadata) GetKey() *string {
if o == nil {
return nil
}
return o.Key
}
func (o *GetLibraryItemsMetadata) GetGUID() *string {
if o == nil {
return nil
}
return o.GUID
}
func (o *GetLibraryItemsMetadata) GetStudio() *string {
if o == nil {
return nil
}
return o.Studio
}
func (o *GetLibraryItemsMetadata) GetType() *string {
if o == nil {
return nil
}
return o.Type
}
func (o *GetLibraryItemsMetadata) GetTitle() *string {
if o == nil {
return nil
}
return o.Title
}
func (o *GetLibraryItemsMetadata) GetContentRating() *string {
if o == nil {
return nil
}
return o.ContentRating
}
func (o *GetLibraryItemsMetadata) GetSummary() *string {
if o == nil {
return nil
}
return o.Summary
}
func (o *GetLibraryItemsMetadata) GetRating() *float64 {
if o == nil {
return nil
}
return o.Rating
}
func (o *GetLibraryItemsMetadata) GetAudienceRating() *float64 {
if o == nil {
return nil
}
return o.AudienceRating
}
func (o *GetLibraryItemsMetadata) GetYear() *int {
if o == nil {
return nil
}
return o.Year
}
func (o *GetLibraryItemsMetadata) GetTagline() *string {
if o == nil {
return nil
}
return o.Tagline
}
func (o *GetLibraryItemsMetadata) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetLibraryItemsMetadata) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetLibraryItemsMetadata) GetDuration() *int {
if o == nil {
return nil
}
return o.Duration
}
func (o *GetLibraryItemsMetadata) GetOriginallyAvailableAt() *types.Date {
if o == nil {
return nil
}
return o.OriginallyAvailableAt
}
func (o *GetLibraryItemsMetadata) GetAddedAt() *int {
if o == nil {
return nil
}
return o.AddedAt
}
func (o *GetLibraryItemsMetadata) GetUpdatedAt() *int {
if o == nil {
return nil
}
return o.UpdatedAt
}
func (o *GetLibraryItemsMetadata) GetAudienceRatingImage() *string {
if o == nil {
return nil
}
return o.AudienceRatingImage
}
func (o *GetLibraryItemsMetadata) GetChapterSource() *string {
if o == nil {
return nil
}
return o.ChapterSource
}
func (o *GetLibraryItemsMetadata) GetPrimaryExtraKey() *string {
if o == nil {
return nil
}
return o.PrimaryExtraKey
}
func (o *GetLibraryItemsMetadata) GetRatingImage() *string {
if o == nil {
return nil
}
return o.RatingImage
}
func (o *GetLibraryItemsMetadata) GetGrandparentRatingKey() *string {
if o == nil {
return nil
}
return o.GrandparentRatingKey
}
func (o *GetLibraryItemsMetadata) GetGrandparentGUID() *string {
if o == nil {
return nil
}
return o.GrandparentGUID
}
func (o *GetLibraryItemsMetadata) GetGrandparentKey() *string {
if o == nil {
return nil
}
return o.GrandparentKey
}
func (o *GetLibraryItemsMetadata) GetGrandparentTitle() *string {
if o == nil {
return nil
}
return o.GrandparentTitle
}
func (o *GetLibraryItemsMetadata) GetGrandparentThumb() *string {
if o == nil {
return nil
}
return o.GrandparentThumb
}
func (o *GetLibraryItemsMetadata) GetGrandparentArt() *string {
if o == nil {
return nil
}
return o.GrandparentArt
}
func (o *GetLibraryItemsMetadata) GetGrandparentTheme() *string {
if o == nil {
return nil
}
return o.GrandparentTheme
}
func (o *GetLibraryItemsMetadata) GetMedia() []GetLibraryItemsMedia {
if o == nil {
return nil
}
return o.Media
}
func (o *GetLibraryItemsMetadata) GetGenre() []GetLibraryItemsGenre {
if o == nil {
return nil
}
return o.Genre
}
func (o *GetLibraryItemsMetadata) GetCountry() []GetLibraryItemsCountry {
if o == nil {
return nil
}
return o.Country
}
func (o *GetLibraryItemsMetadata) GetDirector() []GetLibraryItemsDirector {
if o == nil {
return nil
}
return o.Director
}
func (o *GetLibraryItemsMetadata) GetWriter() []GetLibraryItemsWriter {
if o == nil {
return nil
}
return o.Writer
}
func (o *GetLibraryItemsMetadata) GetRole() []GetLibraryItemsRole {
if o == nil {
return nil
}
return o.Role
}
func (o *GetLibraryItemsMetadata) GetTitleSort() *string {
if o == nil {
return nil
}
return o.TitleSort
}
func (o *GetLibraryItemsMetadata) GetViewCount() *int {
if o == nil {
return nil
}
return o.ViewCount
}
func (o *GetLibraryItemsMetadata) GetLastViewedAt() *int {
if o == nil {
return nil
}
return o.LastViewedAt
}
func (o *GetLibraryItemsMetadata) GetOriginalTitle() *string {
if o == nil {
return nil
}
return o.OriginalTitle
}
func (o *GetLibraryItemsMetadata) GetViewOffset() *int {
if o == nil {
return nil
}
return o.ViewOffset
}
func (o *GetLibraryItemsMetadata) GetSkipCount() *int {
if o == nil {
return nil
}
return o.SkipCount
}
func (o *GetLibraryItemsMetadata) GetIndex() *int {
if o == nil {
return nil
}
return o.Index
}
func (o *GetLibraryItemsMetadata) GetTheme() *string {
if o == nil {
return nil
}
return o.Theme
}
func (o *GetLibraryItemsMetadata) GetLeafCount() *int {
if o == nil {
return nil
}
return o.LeafCount
}
func (o *GetLibraryItemsMetadata) GetViewedLeafCount() *int {
if o == nil {
return nil
}
return o.ViewedLeafCount
}
func (o *GetLibraryItemsMetadata) GetChildCount() *int {
if o == nil {
return nil
}
return o.ChildCount
}
func (o *GetLibraryItemsMetadata) GetHasPremiumExtras() *string {
if o == nil {
return nil
}
return o.HasPremiumExtras
}
func (o *GetLibraryItemsMetadata) GetHasPremiumPrimaryExtra() *string {
if o == nil {
return nil
}
return o.HasPremiumPrimaryExtra
}
func (o *GetLibraryItemsMetadata) GetParentRatingKey() *string {
if o == nil {
return nil
}
return o.ParentRatingKey
}
func (o *GetLibraryItemsMetadata) GetParentGUID() *string {
if o == nil {
return nil
}
return o.ParentGUID
}
func (o *GetLibraryItemsMetadata) GetParentStudio() *string {
if o == nil {
return nil
}
return o.ParentStudio
}
func (o *GetLibraryItemsMetadata) GetParentKey() *string {
if o == nil {
return nil
}
return o.ParentKey
}
func (o *GetLibraryItemsMetadata) GetParentTitle() *string {
if o == nil {
return nil
}
return o.ParentTitle
}
func (o *GetLibraryItemsMetadata) GetParentIndex() *int {
if o == nil {
return nil
}
return o.ParentIndex
}
func (o *GetLibraryItemsMetadata) GetParentYear() *int {
if o == nil {
return nil
}
return o.ParentYear
}
func (o *GetLibraryItemsMetadata) GetParentThumb() *string {
if o == nil {
return nil
}
return o.ParentThumb
}
func (o *GetLibraryItemsMetadata) GetParentTheme() *string {
if o == nil {
return nil
}
return o.ParentTheme
}
type GetLibraryItemsMediaContainer struct {
Size *int `json:"size,omitempty"`
AllowSync *bool `json:"allowSync,omitempty"`
Art *string `json:"art,omitempty"`
Identifier *string `json:"identifier,omitempty"`
LibrarySectionID *int `json:"librarySectionID,omitempty"`
LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"`
LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"`
MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"`
MediaTagVersion *int `json:"mediaTagVersion,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Title1 *string `json:"title1,omitempty"`
Title2 *string `json:"title2,omitempty"`
ViewGroup *string `json:"viewGroup,omitempty"`
ViewMode *int `json:"viewMode,omitempty"`
MixedParents *bool `json:"mixedParents,omitempty"`
Metadata []GetLibraryItemsMetadata `json:"Metadata,omitempty"`
}
func (o *GetLibraryItemsMediaContainer) GetSize() *int {
if o == nil {
return nil
}
return o.Size
}
func (o *GetLibraryItemsMediaContainer) GetAllowSync() *bool {
if o == nil {
return nil
}
return o.AllowSync
}
func (o *GetLibraryItemsMediaContainer) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetLibraryItemsMediaContainer) GetIdentifier() *string {
if o == nil {
return nil
}
return o.Identifier
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionID() *int {
if o == nil {
return nil
}
return o.LibrarySectionID
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionTitle() *string {
if o == nil {
return nil
}
return o.LibrarySectionTitle
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionUUID() *string {
if o == nil {
return nil
}
return o.LibrarySectionUUID
}
func (o *GetLibraryItemsMediaContainer) GetMediaTagPrefix() *string {
if o == nil {
return nil
}
return o.MediaTagPrefix
}
func (o *GetLibraryItemsMediaContainer) GetMediaTagVersion() *int {
if o == nil {
return nil
}
return o.MediaTagVersion
}
func (o *GetLibraryItemsMediaContainer) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetLibraryItemsMediaContainer) GetTitle1() *string {
if o == nil {
return nil
}
return o.Title1
}
func (o *GetLibraryItemsMediaContainer) GetTitle2() *string {
if o == nil {
return nil
}
return o.Title2
}
func (o *GetLibraryItemsMediaContainer) GetViewGroup() *string {
if o == nil {
return nil
}
return o.ViewGroup
}
func (o *GetLibraryItemsMediaContainer) GetViewMode() *int {
if o == nil {
return nil
}
return o.ViewMode
}
func (o *GetLibraryItemsMediaContainer) GetMixedParents() *bool {
if o == nil {
return nil
}
return o.MixedParents
}
func (o *GetLibraryItemsMediaContainer) GetMetadata() []GetLibraryItemsMetadata {
if o == nil {
return nil
}
return o.Metadata
}
// GetLibraryItemsResponseBody - The contents of the library by section and tag
type GetLibraryItemsResponseBody struct {
MediaContainer *GetLibraryItemsMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetLibraryItemsResponseBody) GetMediaContainer() *GetLibraryItemsMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetLibraryItemsResponse struct {
// HTTP response content type for this operation
ContentType string
// HTTP response status code for this operation
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
// The contents of the library by section and tag
Object *GetLibraryItemsResponseBody
}
func (o *GetLibraryItemsResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetLibraryItemsResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetLibraryItemsResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetLibraryItemsResponse) GetObject() *GetLibraryItemsResponseBody {
if o == nil {
return nil
}
return o.Object
}

View File

@@ -78,9 +78,11 @@ func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.Creat
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -193,9 +195,11 @@ func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.P
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -304,9 +308,11 @@ func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64) (*opera
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -414,9 +420,11 @@ func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64) (*op
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -519,9 +527,11 @@ func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64, titl
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -626,9 +636,11 @@ func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64,
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -736,9 +748,11 @@ func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float6
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -842,9 +856,11 @@ func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64,
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -957,9 +973,11 @@ func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force opera
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -93,9 +93,11 @@ func (s *Plex) GetPin(ctx context.Context, strong *bool, xPlexClientIdentifier *
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -222,9 +224,11 @@ func (s *Plex) GetToken(ctx context.Context, pinID string, xPlexClientIdentifier
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -276,9 +276,9 @@ func New(opts ...SDKOption) *PlexAPI {
sdkConfiguration: sdkConfiguration{ sdkConfiguration: sdkConfiguration{
Language: "go", Language: "go",
OpenAPIDocVersion: "0.0.3", OpenAPIDocVersion: "0.0.3",
SDKVersion: "0.6.3", SDKVersion: "0.7.0",
GenVersion: "2.301.3", GenVersion: "2.326.3",
UserAgent: "speakeasy-sdk/go 0.6.3 2.301.3 0.0.3 github.com/LukeHagar/plexgo", UserAgent: "speakeasy-sdk/go 0.7.0 2.326.3 0.0.3 github.com/LukeHagar/plexgo",
Globals: globals.Globals{}, Globals: globals.Globals{},
ServerDefaults: []map[string]string{ ServerDefaults: []map[string]string{
{ {

View File

@@ -91,9 +91,11 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -199,9 +201,11 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -302,9 +306,11 @@ func (s *Search) GetSearchResults(ctx context.Context, query string) (*operation
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -69,9 +69,11 @@ func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServ
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -175,9 +177,11 @@ func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServe
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -281,9 +285,11 @@ func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvaila
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -387,9 +393,11 @@ func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -493,9 +501,11 @@ func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerId
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -599,9 +609,11 @@ func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAcc
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -709,9 +721,11 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -804,9 +818,11 @@ func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListRe
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -69,9 +69,11 @@ func (s *Sessions) GetSessions(ctx context.Context) (*operations.GetSessionsResp
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -175,9 +177,11 @@ func (s *Sessions) GetSessionHistory(ctx context.Context) (*operations.GetSessio
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -281,9 +285,11 @@ func (s *Sessions) GetTranscodeSessions(ctx context.Context) (*operations.GetTra
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -391,9 +397,11 @@ func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -77,9 +77,11 @@ func (s *Statistics) GetStatistics(ctx context.Context, timespan *int64) (*opera
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -70,9 +70,11 @@ func (s *Updater) GetUpdateStatus(ctx context.Context) (*operations.GetUpdateSta
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -184,9 +186,11 @@ func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Down
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -288,9 +292,11 @@ func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight,
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "500", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "500", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)

View File

@@ -73,9 +73,11 @@ func (s *Video) GetTimeline(ctx context.Context, request operations.GetTimelineR
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
@@ -172,9 +174,11 @@ func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) { } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
} }
} else { } else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)