diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 3071e95..ea9728c 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 management: - docChecksum: 184db864cffee563d43aae06915b9671 + docChecksum: fa4c9c5c23680ad02fdbe831ad9d2403 docVersion: 0.0.3 - speakeasyVersion: 1.529.1 - generationVersion: 2.566.5 - releaseVersion: 0.20.1 - configChecksum: 6b459cac508d9817dc4a3e6838c1d331 + speakeasyVersion: 1.531.4 + generationVersion: 2.570.4 + releaseVersion: 0.20.2 + configChecksum: da09b9fb064187056564b4426f7aa2d0 repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo @@ -14,8 +14,8 @@ management: features: go: additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.11 - core: 3.7.3 + constsAndDefaults: 0.1.12 + core: 3.7.4 defaultEnabledRetries: 0.2.0 deprecations: 2.81.3 downloadStreams: 0.1.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1378f8b..70a6a77 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false go: - version: 0.20.1 + version: 0.20.2 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 28ad1d1..20191c7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.529.1 +speakeasyVersion: 1.531.4 sources: my-source: sourceNamespace: my-source @@ -9,19 +9,19 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:ea508e3da23b283f47aeb4384d6b3ab374a27bdffb8d8d8376cedbad3ad77a06 - sourceBlobDigest: sha256:c210adbd02b0213b9e6f95ffc27f60ec38f8f9040137d55ccf2b650d92ab0ff5 + sourceRevisionDigest: sha256:db75a06885b897418dcb580679b5f744348573ad317155172346d32442420e5e + sourceBlobDigest: sha256:ac0a3c3a6df002378b3522325c2330ba4309fbbbfa503a04b8267398f20033f5 tags: - latest - - speakeasy-sdk-regen-1743984636 + - speakeasy-sdk-regen-1744675819 targets: plexgo: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:ea508e3da23b283f47aeb4384d6b3ab374a27bdffb8d8d8376cedbad3ad77a06 - sourceBlobDigest: sha256:c210adbd02b0213b9e6f95ffc27f60ec38f8f9040137d55ccf2b650d92ab0ff5 + sourceRevisionDigest: sha256:db75a06885b897418dcb580679b5f744348573ad317155172346d32442420e5e + sourceBlobDigest: sha256:ac0a3c3a6df002378b3522325c2330ba4309fbbbfa503a04b8267398f20033f5 codeSamplesNamespace: code-samples-go-plexgo - codeSamplesRevisionDigest: sha256:ef5bb03310bad5411cc93a8368bd70b3decee2a407df1bdaab1edd61cd96c5ad + codeSamplesRevisionDigest: sha256:36a583178379fbac0c0950fc49c672f2a422d773e8d969201d20c5c1e2215687 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 4a8490d..c5a7d87 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1102,4 +1102,14 @@ Based on: ### Generated - [go v0.20.1] . ### Releases -- [Go v0.20.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.1 - . \ No newline at end of file +- [Go v0.20.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.1 - . + +## 2025-04-15 00:10:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.531.4 (2.570.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.20.2] . +### Releases +- [Go v0.20.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.20.2 - . \ No newline at end of file diff --git a/docs/models/operations/getalllibrariesdirectory.md b/docs/models/operations/getalllibrariesdirectory.md index 87a4295..a080408 100644 --- a/docs/models/operations/getalllibrariesdirectory.md +++ b/docs/models/operations/getalllibrariesdirectory.md @@ -3,26 +3,26 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | -| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | -| `Composite` | *string* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 | -| `Filters` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `Refreshing` | *bool* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true | -| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | -| `Key` | *string* | :heavy_check_mark: | The library key representing the unique identifier | 1 | -| `Type` | [operations.GetAllLibrariesType](../../models/operations/getalllibrariestype.md) | :heavy_check_mark: | N/A | movie | -| `Title` | *string* | :heavy_check_mark: | The title of the library | Movies | -| `Agent` | *string* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie | -| `Scanner` | *string* | :heavy_check_mark: | UNKNOWN | Plex Movie | -| `Language` | *string* | :heavy_check_mark: | The Plex library language that has been set | en-US | -| `UUID` | *string* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 | -| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | 1556281940 | -| `ScannedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | -| `Content` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `Directory` | *bool* | :heavy_check_mark: | UNKNOWN | true | -| `ContentChangedAt` | *int* | :heavy_check_mark: | The number of seconds since the content was last changed relative to now. | 9173960 | -| `Hidden` | [*operations.Hidden](../../models/operations/hidden.md) | :heavy_minus_sign: | N/A | 1 | -| `Location` | [][operations.GetAllLibrariesLocation](../../models/operations/getalllibrarieslocation.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `AllowSync` | *bool* | :heavy_check_mark: | Indicates whether syncing is allowed. | false | +| `Art` | *string* | :heavy_check_mark: | URL for the background artwork of the media container. | /:/resources/show-fanart.jpg | +| `Composite` | *string* | :heavy_check_mark: | The relative path to the composite media item. | /library/sections/1/composite/1743824484 | +| `Filters` | *bool* | :heavy_check_mark: | UNKNOWN | true | +| `Refreshing` | *bool* | :heavy_check_mark: | Indicates whether the library is currently being refreshed or updated | true | +| `Thumb` | *string* | :heavy_check_mark: | URL for the thumbnail image of the media container. | /:/resources/show.png | +| `Key` | *string* | :heavy_check_mark: | The library key representing the unique identifier | 1 | +| `Type` | [operations.GetAllLibrariesType](../../models/operations/getalllibrariestype.md) | :heavy_check_mark: | N/A | movie | +| `Title` | *string* | :heavy_check_mark: | The title of the library | Movies | +| `Agent` | *string* | :heavy_check_mark: | The Plex agent used to match and retrieve media metadata. | tv.plex.agents.movie | +| `Scanner` | *string* | :heavy_check_mark: | UNKNOWN | Plex Movie | +| `Language` | *string* | :heavy_check_mark: | The Plex library language that has been set | en-US | +| `UUID` | *string* | :heavy_check_mark: | The universally unique identifier for the library. | e69655a2-ef48-4aba-bb19-01e7d3cc34d6 | +| `UpdatedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `CreatedAt` | **int64* | :heavy_minus_sign: | N/A | 1556281940 | +| `ScannedAt` | *int64* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `Content` | *bool* | :heavy_check_mark: | UNKNOWN | true | +| `Directory` | *bool* | :heavy_check_mark: | UNKNOWN | true | +| `ContentChangedAt` | *int64* | :heavy_check_mark: | Timestamp (in seconds) representing the last time the content was modified.
NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64
| 9173960 | +| `Hidden` | [*operations.Hidden](../../models/operations/hidden.md) | :heavy_minus_sign: | N/A | 1 | +| `Location` | [][operations.GetAllLibrariesLocation](../../models/operations/getalllibrarieslocation.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/internal/utils/json.go b/internal/utils/json.go index 913aeaf..c83ef21 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -186,8 +186,8 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool value, ok := unmarhsaled[fieldName] if !ok { - defaultTag := field.Tag.Get("default") - if defaultTag != "" { + defaultTag, defaultOk := field.Tag.Lookup("default") + if defaultOk { value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) ok = true } @@ -257,8 +257,8 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) } if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { - defaultTag := tag.Get("default") - if defaultTag != "" { + defaultTag, ok := tag.Lookup("default") + if ok { return handleDefaultConstValue(defaultTag, v, tag), nil } diff --git a/models/operations/getalllibraries.go b/models/operations/getalllibraries.go index 0340e0c..4d8aae8 100644 --- a/models/operations/getalllibraries.go +++ b/models/operations/getalllibraries.go @@ -131,8 +131,10 @@ type GetAllLibrariesDirectory struct { Content bool `json:"content"` // UNKNOWN Directory bool `json:"directory"` - // The number of seconds since the content was last changed relative to now. - ContentChangedAt int `json:"contentChangedAt"` + // Timestamp (in seconds) representing the last time the content was modified. + // NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64 + // + ContentChangedAt int64 `json:"contentChangedAt"` Hidden *Hidden `default:"0" json:"hidden"` Location []GetAllLibrariesLocation `json:"Location"` } @@ -274,7 +276,7 @@ func (o *GetAllLibrariesDirectory) GetDirectory() bool { return o.Directory } -func (o *GetAllLibrariesDirectory) GetContentChangedAt() int { +func (o *GetAllLibrariesDirectory) GetContentChangedAt() int64 { if o == nil { return 0 } diff --git a/plexapi.go b/plexapi.go index 23043b5..b5f4d9a 100644 --- a/plexapi.go +++ b/plexapi.go @@ -17,7 +17,7 @@ import ( // ServerList contains the list of servers available to the SDK var ServerList = []string{ // The full address of your Plex Server - "{protocol}://{ip}:{port}", + "https://10.10.10.47:32400", } // HTTPClient provides an interface for suplying the SDK with a custom HTTP client @@ -299,9 +299,9 @@ func New(opts ...SDKOption) *PlexAPI { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.3", - SDKVersion: "0.20.1", - GenVersion: "2.566.5", - UserAgent: "speakeasy-sdk/go 0.20.1 2.566.5 0.0.3 github.com/LukeHagar/plexgo", + SDKVersion: "0.20.2", + GenVersion: "2.570.4", + UserAgent: "speakeasy-sdk/go 0.20.2 2.570.4 0.0.3 github.com/LukeHagar/plexgo", ServerDefaults: []map[string]string{ { "protocol": "https",