Compare commits

..

7 Commits

Author SHA1 Message Date
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
19 changed files with 1517 additions and 1351 deletions

View File

@@ -3,10 +3,10 @@ id: dfa99515-01c0-42eb-9be5-ee212fd03eb3
management:
docChecksum: 7a43cd3413d535205cfaee20a4b6a250
docVersion: 0.0.3
speakeasyVersion: 1.270.0
generationVersion: 2.312.1
releaseVersion: 0.6.5
configChecksum: 04a74c0befe573f11c39172466419713
speakeasyVersion: 1.279.0
generationVersion: 2.322.5
releaseVersion: 0.6.7
configChecksum: 78af15bfd6f8be83ea08e1ad8e8c4ace
repoURL: https://github.com/LukeHagar/plexgo.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexgo
@@ -14,14 +14,14 @@ management:
features:
go:
constsAndDefaults: 0.1.4
core: 3.4.6
core: 3.4.7
flattening: 2.81.1
globalSecurity: 2.82.9
globalServerURLs: 2.82.2
globals: 2.82.2
methodServerURLs: 2.82.1
nameOverrides: 2.81.2
responseFormat: 0.1.0
responseFormat: 0.1.1
generatedFiles:
- server.go
- media.go

View File

@@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
go:
version: 0.6.5
version: 0.6.7
additionalDependencies: {}
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.276.0
speakeasyVersion: 1.279.0
sources: {}
targets: {}
workflow:

View File

@@ -283,3 +283,73 @@ Based on:
- [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 - .

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -88,7 +88,7 @@ func main() {
)
var activityUUID string = "<value>"
var activityUUID string = "25b71ed5-0f9d-461c-baa7-d404e9e10d3e"
ctx := context.Background()
res, err := s.Activities.CancelServerActivities(ctx, activityUUID)
@@ -103,10 +103,10 @@ func main() {
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. |
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | 25b71ed5-0f9d-461c-baa7-d404e9e10d3e |
### Response

View File

@@ -142,9 +142,9 @@ func main() {
var key string = "<value>"
var time float64 = 6900.91
var time float64 = 90000
var state string = "<value>"
var state string = "played"
ctx := context.Background()
res, err := s.Media.UpdatePlayProgress(ctx, key, time, state)
@@ -159,12 +159,12 @@ func main() {
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `key` | *string* | :heavy_check_mark: | the media key |
| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. |
| `state` | *string* | :heavy_check_mark: | The playback state of the media item. |
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `key` | *string* | :heavy_check_mark: | the media key | |
| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | 90000 |
| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | played |
### Response

View File

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

View File

@@ -100,10 +100,10 @@ func main() {
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. |
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | 1 |
### Response
@@ -141,7 +141,7 @@ func main() {
var tonight *operations.Tonight = operations.TonightOne.ToPointer()
var skip *operations.Skip = operations.SkipZero.ToPointer()
var skip *operations.Skip = operations.SkipOne.ToPointer()
ctx := context.Background()
res, err := s.Updater.ApplyUpdates(ctx, tonight, skip)
@@ -156,11 +156,11 @@ func main() {
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install |
| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. |
| Parameter | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 |
| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. | 1 |
### Response

View File

@@ -36,16 +36,16 @@ func main() {
ctx := context.Background()
res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{
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,
RatingKey: 23409,
Key: "/library/metadata/23409",
State: operations.StatePlaying,
HasMDE: 1,
Time: 2000,
Duration: 10000,
Context: "home:hub.continueWatching",
PlayQueueItemID: 1,
PlayBackTime: 2000,
Row: 1,
})
if err != nil {
log.Fatal(err)
@@ -97,11 +97,22 @@ func main() {
ctx := context.Background()
res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{
HasMDE: 8924.99,
Path: "/etc/mail",
MediaIndex: 9962.95,
PartIndex: 1232.82,
Protocol: "<value>",
HasMDE: 1,
Path: "/library/metadata/23409",
MediaIndex: 0,
PartIndex: 0,
Protocol: "hls",
FastSeek: plexgo.Float64(0),
DirectPlay: plexgo.Float64(0),
DirectStream: plexgo.Float64(0),
SubtitleSize: plexgo.Float64(100),
Subtites: plexgo.String("burn"),
AudioBoost: plexgo.Float64(100),
Location: plexgo.String("lan"),
MediaBufferSize: plexgo.Float64(102400),
Session: plexgo.String("zvcage8b7rkioqcm8f4uns4c"),
AddDebugOverlay: plexgo.Float64(0),
AutoAdjustQuality: plexgo.Float64(0),
})
if err != nil {
log.Fatal(err)

View File

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

View File

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