Compare commits

...

4 Commits

Author SHA1 Message Date
speakeasy-github[bot]
ec6ef7db64 chore: update dependencies 2024-03-29 16:38:18 +00:00
speakeasybot
32a5beaae6 ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.228.1 2024-03-29 16:37:36 +00:00
speakeasy-github
ea30334a95 chore: update dependencies 2024-03-27 00:44:58 +00:00
speakeasybot
f3eb760757 ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.227.0 2024-03-27 00:44:22 +00:00
41 changed files with 254 additions and 93 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 id: dfa99515-01c0-42eb-9be5-ee212fd03eb3
management: management:
docChecksum: e34dac84738ebf2d447ea2b9055a6eeb docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
docVersion: 0.0.3 docVersion: 0.0.3
speakeasyVersion: 1.213.0 speakeasyVersion: 1.228.1
generationVersion: 2.283.1 generationVersion: 2.292.0
releaseVersion: 0.5.2 releaseVersion: 0.6.0
configChecksum: 180ba7e4c10a508e14fd2d39e146af61 configChecksum: 0a5d37a613eb2b27e32428c43ed96f05
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
@@ -14,10 +14,11 @@ management:
features: features:
go: go:
constsAndDefaults: 0.1.4 constsAndDefaults: 0.1.4
core: 3.4.4 core: 3.4.5
flattening: 2.81.1 flattening: 2.81.1
globalSecurity: 2.82.9 globalSecurity: 2.82.9
globalServerURLs: 2.82.2 globalServerURLs: 2.82.2
globals: 2.82.1
methodServerURLs: 2.82.1 methodServerURLs: 2.82.1
nameOverrides: 2.81.1 nameOverrides: 2.81.1
responseFormat: 0.1.0 responseFormat: 0.1.0

View File

@@ -33,6 +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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -184,6 +185,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -234,6 +236,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -272,6 +275,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -299,14 +303,16 @@ import (
) )
func main() { func main() {
s := plexgo.New() s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"),
var xPlexClientIdentifier string = "<value>" )
var strong *bool = plexgo.Bool(false) var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetPin(ctx, operations.WithServerURL("https://plex.tv/api/v2"), xPlexClientIdentifier, strong) res, err := s.Plex.GetPin(ctx, operations.WithServerURL("https://plex.tv/api/v2"), strong, xPlexClientIdentifier)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -371,6 +377,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -412,6 +419,59 @@ d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on
``` ```
<!-- End Special Types [types] --> <!-- End Special Types [types] -->
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters
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.
### Available Globals
The following global parameter is available. The required parameter must be set when you initialize the SDK client.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| XPlexClientIdentifier | string | ✔️ | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
|
### Example
```go
package main
import (
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"),
)
var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>")
ctx := context.Background()
res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
```
<!-- End Global Parameters [global-parameters] -->
<!-- Placeholder for Future Speakeasy SDK Sections --> <!-- Placeholder for Future Speakeasy SDK Sections -->
# Development # Development

View File

@@ -188,4 +188,24 @@ Based on:
### Generated ### Generated
- [go v0.5.2] . - [go v0.5.2] .
### Releases ### Releases
- [Go v0.5.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.5.2 - . - [Go v0.5.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.5.2 - .
## 2024-03-27 00:44:06
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.227.0 (2.291.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.5.3] .
### Releases
- [Go v0.5.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.5.3 - .
## 2024-03-29 16:37:06
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.228.1 (2.292.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.0] .
### Releases
- [Go v0.6.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.6.0 - .

View File

@@ -12,6 +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>"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -153,7 +153,7 @@ func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID st
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }

View File

@@ -54,7 +54,7 @@ func (s *Authentication) GetTransientToken(ctx context.Context, type_ operations
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -158,7 +158,7 @@ func (s *Authentication) GetSourceConnectionInformation(ctx context.Context, sou
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -345,7 +345,7 @@ func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName) (*
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -446,7 +446,7 @@ func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTask
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }

View File

@@ -5,5 +5,5 @@
| Field | Type | Required | Description | | Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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/> | | `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/> |

View File

@@ -6,4 +6,4 @@
| Field | Type | Required | Description | | Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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_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_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/> |

View File

@@ -36,6 +36,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -83,6 +84,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>"),
) )

View File

@@ -32,6 +32,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>"),
) )
@@ -88,6 +89,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>"),
) )

View File

@@ -33,6 +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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -85,6 +86,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -133,6 +135,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -186,6 +189,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>"),
) )
@@ -239,6 +243,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>"),
) )

View File

@@ -31,6 +31,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>"),
) )
@@ -87,6 +88,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>"),
) )

View File

@@ -39,6 +39,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>"),
) )
@@ -94,6 +95,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -147,6 +149,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -234,6 +237,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>"),
) )
@@ -288,6 +292,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>"),
) )
@@ -360,6 +365,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>"),
) )
@@ -414,6 +420,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>"),
) )
@@ -484,6 +491,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>"),
) )
@@ -538,6 +546,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>"),
) )
@@ -590,6 +599,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>"),
) )
@@ -642,6 +652,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>"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -33,6 +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>"),
) )
@@ -111,6 +112,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -162,6 +164,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>"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -31,6 +31,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>"),
) )
@@ -82,6 +83,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>"),
) )
@@ -134,6 +136,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>"),
) )

View File

@@ -44,6 +44,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -98,6 +99,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>"),
) )
@@ -154,6 +156,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>"),
) )
@@ -206,6 +209,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>"),
) )
@@ -258,6 +262,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>"),
) )
@@ -319,6 +324,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>"),
) )
@@ -374,6 +380,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>"),
) )
@@ -427,6 +434,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>"),
) )
@@ -486,6 +494,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>"),
) )

View File

@@ -27,15 +27,17 @@ import(
) )
func main() { func main() {
s := plexgo.New() s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"),
)
var xPlexClientIdentifier string = "<value>"
var strong *bool = plexgo.Bool(false) var strong *bool = plexgo.Bool(false)
var xPlexClientIdentifier *string = plexgo.String("<value>")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetPin(ctx, xPlexClientIdentifier, strong) res, err := s.Plex.GetPin(ctx, strong, xPlexClientIdentifier)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@@ -50,8 +52,8 @@ func main() {
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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. |
| `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/> |
| `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/> |
| `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. |
@@ -79,12 +81,14 @@ import(
) )
func main() { func main() {
s := plexgo.New() s := plexgo.New(
plexgo.WithXPlexClientIdentifier("<value>"),
)
var pinID string = "<value>" var pinID string = "<value>"
var xPlexClientIdentifier string = "<value>" var xPlexClientIdentifier *string = plexgo.String("<value>")
ctx := context.Background() ctx := context.Background()
res, err := s.Plex.GetToken(ctx, pinID, xPlexClientIdentifier) res, err := s.Plex.GetToken(ctx, pinID, xPlexClientIdentifier)
@@ -103,7 +107,7 @@ func main() {
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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_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_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/> |
| `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. |

View File

@@ -43,6 +43,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>"),
) )
@@ -104,6 +105,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>"),
) )
@@ -161,6 +163,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>"),
) )

View File

@@ -36,6 +36,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -83,6 +84,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -130,6 +132,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -177,6 +180,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -224,6 +228,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -271,6 +276,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -320,6 +326,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -376,6 +383,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>"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -32,6 +32,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -79,6 +80,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -126,6 +128,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -173,6 +176,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>"),
) )

View File

@@ -29,6 +29,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>"),
) )

View File

@@ -32,6 +32,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -80,6 +81,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>"),
) )
@@ -133,6 +135,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>"),
) )

View File

@@ -31,6 +31,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>"),
) )
ctx := context.Background() ctx := context.Background()
@@ -91,6 +92,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>"),
) )
ctx := context.Background() ctx := context.Background()

View File

@@ -12,7 +12,7 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: false oAuth2ClientCredentialsEnabled: false
go: go:
version: 0.5.2 version: 0.6.0
additionalDependencies: {} additionalDependencies: {}
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true flattenGlobalSecurity: true

View File

@@ -54,7 +54,7 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -158,7 +158,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -170,7 +170,7 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -10,7 +10,7 @@ import (
"strings" "strings"
) )
func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{}) { func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{}, globals map[string]map[string]map[string]interface{}) {
headerParamsStructType := reflect.TypeOf(headers) headerParamsStructType := reflect.TypeOf(headers)
headerParamsValType := reflect.ValueOf(headers) headerParamsValType := reflect.ValueOf(headers)
@@ -18,6 +18,8 @@ func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{}
fieldType := headerParamsStructType.Field(i) fieldType := headerParamsStructType.Field(i)
valType := headerParamsValType.Field(i) valType := headerParamsValType.Field(i)
valType = populateFromGlobals(fieldType, valType, "header", globals)
tag := parseParamTag(headerParamTagKey, fieldType, "simple", false) tag := parseParamTag(headerParamTagKey, fieldType, "simple", false)
if tag == nil { if tag == nil {
continue continue

View File

@@ -54,7 +54,7 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64)
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -401,7 +401,7 @@ func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDeta
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -413,7 +413,7 @@ func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDeta
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -515,7 +515,7 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operat
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -634,7 +634,7 @@ func (s *Library) GetLibraryItems(ctx context.Context, sectionID int64, tag oper
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/{tag}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/{tag}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -729,7 +729,7 @@ func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*opera
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/refresh", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/refresh", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -846,7 +846,7 @@ func (s *Library) SearchLibrary(ctx context.Context, sectionID int64, type_ oper
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/search", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/search", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -858,7 +858,7 @@ func (s *Library) SearchLibrary(ctx context.Context, sectionID int64, type_ oper
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -945,7 +945,7 @@ func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operatio
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -1055,7 +1055,7 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64) (*
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/children", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/children", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }

2
log.go
View File

@@ -55,7 +55,7 @@ func (s *Log) LogLine(ctx context.Context, level operations.Level, message strin
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -53,7 +53,7 @@ func (s *Media) MarkPlayed(ctx context.Context, key float64) (*operations.MarkPl
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -156,7 +156,7 @@ func (s *Media) MarkUnplayed(ctx context.Context, key float64) (*operations.Mark
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -261,7 +261,7 @@ func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -13,16 +13,16 @@ var GetPinServerList = []string{
} }
type GetPinRequest struct { type GetPinRequest struct {
// The unique identifier for the client application
// This is used to track the client application and its usage
// (UUID, serial number, or other number unique per device)
//
XPlexClientIdentifier string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
// Determines the kind of code returned by the API call // Determines the kind of code returned by the API call
// Strong codes are used for Pin authentication flows // Strong codes are used for Pin authentication flows
// Non-Strong codes are used for `Plex.tv/link` // Non-Strong codes are used for `Plex.tv/link`
// //
Strong *bool `default:"false" queryParam:"style=form,explode=true,name=strong"` Strong *bool `default:"false" queryParam:"style=form,explode=true,name=strong"`
// The unique identifier for the client application
// This is used to track the client application and its usage
// (UUID, serial number, or other number unique per device)
//
XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
} }
func (g GetPinRequest) MarshalJSON() ([]byte, error) { func (g GetPinRequest) MarshalJSON() ([]byte, error) {
@@ -36,13 +36,6 @@ func (g *GetPinRequest) UnmarshalJSON(data []byte) error {
return nil return nil
} }
func (o *GetPinRequest) GetXPlexClientIdentifier() string {
if o == nil {
return ""
}
return o.XPlexClientIdentifier
}
func (o *GetPinRequest) GetStrong() *bool { func (o *GetPinRequest) GetStrong() *bool {
if o == nil { if o == nil {
return nil return nil
@@ -50,6 +43,13 @@ func (o *GetPinRequest) GetStrong() *bool {
return o.Strong return o.Strong
} }
func (o *GetPinRequest) GetXPlexClientIdentifier() *string {
if o == nil {
return nil
}
return o.XPlexClientIdentifier
}
type Location struct { type Location struct {
Code *string `json:"code,omitempty"` Code *string `json:"code,omitempty"`
EuropeanUnionMember *bool `json:"european_union_member,omitempty"` EuropeanUnionMember *bool `json:"european_union_member,omitempty"`

View File

@@ -17,7 +17,7 @@ type GetTokenRequest struct {
// This is used to track the client application and its usage // This is used to track the client application and its usage
// (UUID, serial number, or other number unique per device) // (UUID, serial number, or other number unique per device)
// //
XPlexClientIdentifier string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"` XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
} }
func (o *GetTokenRequest) GetPinID() string { func (o *GetTokenRequest) GetPinID() string {
@@ -27,9 +27,9 @@ func (o *GetTokenRequest) GetPinID() string {
return o.PinID return o.PinID
} }
func (o *GetTokenRequest) GetXPlexClientIdentifier() string { func (o *GetTokenRequest) GetXPlexClientIdentifier() *string {
if o == nil { if o == nil {
return "" return nil
} }
return o.XPlexClientIdentifier return o.XPlexClientIdentifier
} }

View File

@@ -54,7 +54,7 @@ func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.Creat
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -169,7 +169,7 @@ func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.P
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -272,7 +272,7 @@ func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64) (*opera
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -382,7 +382,7 @@ func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64) (*op
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -483,7 +483,7 @@ func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64, titl
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -495,7 +495,7 @@ func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64, titl
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -590,7 +590,7 @@ func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64,
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -602,7 +602,7 @@ func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64,
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -704,7 +704,7 @@ func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float6
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -806,7 +806,7 @@ func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64,
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -818,7 +818,7 @@ func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64,
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -933,7 +933,7 @@ func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force opera
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

14
plex.go
View File

@@ -28,7 +28,7 @@ func newPlex(sdkConfig sdkConfiguration) *Plex {
// GetPin - Get a Pin // GetPin - Get a Pin
// Retrieve a Pin from Plex.tv for authentication flows // Retrieve a Pin from Plex.tv for authentication flows
func (s *Plex) GetPin(ctx context.Context, xPlexClientIdentifier string, strong *bool, opts ...operations.Option) (*operations.GetPinResponse, error) { func (s *Plex) GetPin(ctx context.Context, strong *bool, xPlexClientIdentifier *string, opts ...operations.Option) (*operations.GetPinResponse, error) {
hookCtx := hooks.HookContext{ hookCtx := hooks.HookContext{
Context: ctx, Context: ctx,
OperationID: "getPin", OperationID: "getPin",
@@ -37,8 +37,8 @@ func (s *Plex) GetPin(ctx context.Context, xPlexClientIdentifier string, strong
} }
request := operations.GetPinRequest{ request := operations.GetPinRequest{
XPlexClientIdentifier: xPlexClientIdentifier,
Strong: strong, Strong: strong,
XPlexClientIdentifier: xPlexClientIdentifier,
} }
o := operations.Options{} o := operations.Options{}
@@ -68,9 +68,9 @@ func (s *Plex) GetPin(ctx context.Context, xPlexClientIdentifier string, strong
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
utils.PopulateHeaders(ctx, req, request) utils.PopulateHeaders(ctx, req, request, s.sdkConfiguration.Globals)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -153,7 +153,7 @@ func (s *Plex) GetPin(ctx context.Context, xPlexClientIdentifier string, strong
// GetToken - Get Access Token // GetToken - Get Access Token
// Retrieve an Access Token from Plex.tv after the Pin has already been authenticated // Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
func (s *Plex) GetToken(ctx context.Context, pinID string, xPlexClientIdentifier string, opts ...operations.Option) (*operations.GetTokenResponse, error) { func (s *Plex) GetToken(ctx context.Context, pinID string, xPlexClientIdentifier *string, opts ...operations.Option) (*operations.GetTokenResponse, error) {
hookCtx := hooks.HookContext{ hookCtx := hooks.HookContext{
Context: ctx, Context: ctx,
OperationID: "getToken", OperationID: "getToken",
@@ -181,7 +181,7 @@ func (s *Plex) GetToken(ctx context.Context, pinID string, xPlexClientIdentifier
baseURL = *o.ServerURL baseURL = *o.ServerURL
} }
opURL, err := utils.GenerateURL(ctx, baseURL, "/pins/{pinID}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/pins/{pinID}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }
@@ -193,7 +193,7 @@ func (s *Plex) GetToken(ctx context.Context, pinID string, xPlexClientIdentifier
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
utils.PopulateHeaders(ctx, req, request) utils.PopulateHeaders(ctx, req, request, s.sdkConfiguration.Globals)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil { if err != nil {

View File

@@ -53,6 +53,7 @@ type sdkConfiguration struct {
SDKVersion string SDKVersion string
GenVersion string GenVersion string
UserAgent string UserAgent string
Globals map[string]map[string]map[string]interface{}
RetryConfig *utils.RetryConfig RetryConfig *utils.RetryConfig
Hooks *hooks.Hooks Hooks *hooks.Hooks
} }
@@ -255,6 +256,17 @@ func WithSecuritySource(security func(context.Context) (components.Security, err
} }
} }
// WithXPlexClientIdentifier allows setting the XPlexClientIdentifier parameter for all supported operations
func WithXPlexClientIdentifier(xPlexClientIdentifier string) SDKOption {
return func(sdk *PlexAPI) {
if _, ok := sdk.sdkConfiguration.Globals["parameters"]["header"]; !ok {
sdk.sdkConfiguration.Globals["parameters"]["header"] = map[string]interface{}{}
}
sdk.sdkConfiguration.Globals["parameters"]["header"]["XPlexClientIdentifier"] = xPlexClientIdentifier
}
}
func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption { func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption {
return func(sdk *PlexAPI) { return func(sdk *PlexAPI) {
sdk.sdkConfiguration.RetryConfig = &retryConfig sdk.sdkConfiguration.RetryConfig = &retryConfig
@@ -267,9 +279,12 @@ func New(opts ...SDKOption) *PlexAPI {
sdkConfiguration: sdkConfiguration{ sdkConfiguration: sdkConfiguration{
Language: "go", Language: "go",
OpenAPIDocVersion: "0.0.3", OpenAPIDocVersion: "0.0.3",
SDKVersion: "0.5.2", SDKVersion: "0.6.0",
GenVersion: "2.283.1", GenVersion: "2.292.0",
UserAgent: "speakeasy-sdk/go 0.5.2 2.283.1 0.0.3 github.com/LukeHagar/plexgo", UserAgent: "speakeasy-sdk/go 0.6.0 2.292.0 0.0.3 github.com/LukeHagar/plexgo",
Globals: map[string]map[string]map[string]interface{}{
"parameters": {},
},
ServerDefaults: []map[string]string{ ServerDefaults: []map[string]string{
{ {
"protocol": "http", "protocol": "http",

View File

@@ -67,7 +67,7 @@ func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *flo
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -175,7 +175,7 @@ func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -278,7 +278,7 @@ func (s *Search) GetSearchResults(ctx context.Context, query string) (*operation
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -685,7 +685,7 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -359,7 +359,7 @@ func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string)
} }
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/transcode/sessions/{sessionKey}", request, nil) opURL, err := utils.GenerateURL(ctx, baseURL, "/transcode/sessions/{sessionKey}", request, s.sdkConfiguration.Globals)
if err != nil { if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err) return nil, fmt.Errorf("error generating URL: %w", err)
} }

View File

@@ -53,7 +53,7 @@ func (s *Statistics) GetStatistics(ctx context.Context, timespan *int64) (*opera
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -160,7 +160,7 @@ func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Down
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -264,7 +264,7 @@ func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight,
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }

View File

@@ -49,7 +49,7 @@ func (s *Video) GetTimeline(ctx context.Context, request operations.GetTimelineR
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }
@@ -148,7 +148,7 @@ func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { if err := utils.PopulateQueryParams(ctx, req, request, s.sdkConfiguration.Globals); err != nil {
return nil, fmt.Errorf("error populating query params: %w", err) return nil, fmt.Errorf("error populating query params: %w", err)
} }