From 484b48c27127000c097b2004a711873b80a22b7e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 16 Sep 2025 00:11:29 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.615.2 --- .gitignore | 2 + .speakeasy/gen.lock | 18 +++--- .speakeasy/gen.yaml | 4 +- .speakeasy/workflow.lock | 14 ++-- RELEASES.md | 12 +++- internal/utils/json.go | 67 ++++++++++---------- internal/utils/retries.go | 52 ++++++++++++++- internal/utils/utils.go | 4 +- models/operations/getalllibraries.go | 2 +- models/operations/getgeodata.go | 2 +- models/operations/getlibrarydetails.go | 2 +- models/operations/getlibraryhubs.go | 2 +- models/operations/getlibraryitems.go | 24 +++---- models/operations/getlibrarysectionsall.go | 26 ++++---- models/operations/getmediametadata.go | 22 +++---- models/operations/getpin.go | 6 +- models/operations/getplaylistcontents.go | 2 +- models/operations/getrecentlyadded.go | 26 ++++---- models/operations/getrecentlyaddedlibrary.go | 6 +- models/operations/getresizedphoto.go | 2 +- models/operations/getsearchalllibraries.go | 24 +++---- models/operations/getsearchresults.go | 2 +- models/operations/getserverresources.go | 4 +- models/operations/getsessionhistory.go | 2 +- models/operations/gettokenbypinid.go | 4 +- models/operations/gettokendetails.go | 4 +- models/operations/gettopwatchedcontent.go | 4 +- models/operations/getuserfriends.go | 2 +- models/operations/getusers.go | 4 +- models/operations/getwatchlist.go | 6 +- models/operations/performsearch.go | 2 +- models/operations/performvoicesearch.go | 2 +- models/operations/postuserssignindata.go | 8 +-- models/operations/uploadplaylist.go | 2 +- plexapi.go | 6 +- 35 files changed, 217 insertions(+), 154 deletions(-) diff --git a/.gitignore b/.gitignore index 5f88fc7..1094509 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env +.env.local .DS_Store **/.speakeasy/temp/ **/.speakeasy/logs/ diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ce474dc..7d540a0 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: 77bdddd188d0778dc73b7f7906e1677c + docChecksum: addaf2dfdac23cef2e234b64492b9c90 docVersion: 0.0.3 - speakeasyVersion: 1.598.3 - generationVersion: 2.674.3 - releaseVersion: 0.24.1 - configChecksum: 572fddd978a14316b2f4d53532d95815 + speakeasyVersion: 1.615.2 + generationVersion: 2.698.4 + releaseVersion: 0.24.2 + configChecksum: 8d76d795a093eac0731c22ff2789a575 repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo @@ -15,7 +15,7 @@ features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.12 - core: 3.9.3 + core: 3.9.6 defaultEnabledRetries: 0.2.0 deprecations: 2.81.3 downloadStreams: 0.1.2 @@ -23,7 +23,7 @@ features: envVarSecurityUsage: 0.3.2 errors: 2.83.0 flattening: 2.81.1 - globalSecurity: 2.82.11 + globalSecurity: 2.82.12 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.3 @@ -33,9 +33,9 @@ features: nullables: 0.1.1 openEnums: 0.1.0 responseFormat: 0.1.2 - retries: 2.84.0 + retries: 2.84.2 sdkHooks: 0.2.0 - unions: 2.85.12 + unions: 2.85.14 uploadStreams: 0.1.0 generatedFiles: - .gitattributes diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 04f1f5a..034cb2a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,12 +16,13 @@ generation: auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false + hoistGlobalSecurity: true tests: generateTests: true generateNewTests: false skipResponseBodyAssertions: false go: - version: 0.24.1 + version: 0.24.2 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: PlexAPIError @@ -42,5 +43,6 @@ go: modulePath: "" outputModelSuffix: output packageName: github.com/LukeHagar/plexgo + respectRequiredFields: false responseFormat: envelope sdkPackageName: "" diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7acee7e..0628dac 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.598.3 +speakeasyVersion: 1.615.2 sources: my-source: sourceNamespace: my-source @@ -9,19 +9,19 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577 - sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1 + sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 + sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 tags: - latest - - speakeasy-sdk-regen-1754525524 + - speakeasy-sdk-regen-1757981413 targets: plexgo: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577 - sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1 + sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 + sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 codeSamplesNamespace: code-samples-go-plexgo - codeSamplesRevisionDigest: sha256:b3b33cad9d51c5c7b91f0fb005d52d487405e8a7a6e60663cec67546202aac78 + codeSamplesRevisionDigest: sha256:918f406f027ab1b34a6256235e3389f56c35fa6b319855542a8c2bccc8c97e1a workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 589fe8b..43ecf9d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1192,4 +1192,14 @@ Based on: ### Generated - [go v0.24.1] . ### Releases -- [Go v0.24.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.24.1 - . \ No newline at end of file +- [Go v0.24.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.24.1 - . + +## 2025-09-16 00:09:55 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.615.2 (2.698.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.24.2] . +### Releases +- [Go v0.24.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.24.2 - . \ No newline at end of file diff --git a/internal/utils/json.go b/internal/utils/json.go index c83ef21..b349b9b 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -5,6 +5,7 @@ package utils import ( "bytes" "encoding/json" + "errors" "fmt" "math/big" "reflect" @@ -114,9 +115,9 @@ func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, e } } -func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { +func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, requiredFields []string) error { if reflect.TypeOf(v).Kind() != reflect.Ptr { - return fmt.Errorf("v must be a pointer") + return errors.New("v must be a pointer") } typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) @@ -124,19 +125,25 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool switch { case isModelType(typ): if topLevel || bytes.Equal(b, []byte("null")) { - d := json.NewDecoder(bytes.NewReader(b)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(v) + return json.Unmarshal(b, v) } - var unmarhsaled map[string]json.RawMessage + var unmarshaled map[string]json.RawMessage - if err := json.Unmarshal(b, &unmarhsaled); err != nil { + if err := json.Unmarshal(b, &unmarshaled); err != nil { return err } + missingFields := []string{} + for _, requiredField := range requiredFields { + if _, ok := unmarshaled[requiredField]; !ok { + missingFields = append(missingFields, requiredField) + } + } + if len(missingFields) > 0 { + return fmt.Errorf("missing required fields: %s", strings.Join(missingFields, ", ")) + } + var additionalPropertiesField *reflect.StructField var additionalPropertiesValue *reflect.Value @@ -163,7 +170,7 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool // If we receive a value for a const field ignore it but mark it as unmarshaled if field.Tag.Get("const") != "" { - if r, ok := unmarhsaled[fieldName]; ok { + if r, ok := unmarshaled[fieldName]; ok { val := string(r) if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { @@ -178,13 +185,13 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool return fmt.Errorf("const field `%s` does not match expected value `%s` got `%s`", fieldName, constValue, val) } - delete(unmarhsaled, fieldName) + delete(unmarshaled, fieldName) } } else if !field.IsExported() { continue } - value, ok := unmarhsaled[fieldName] + value, ok := unmarshaled[fieldName] if !ok { defaultTag, defaultOk := field.Tag.Lookup("default") if defaultOk { @@ -192,26 +199,22 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool ok = true } } else { - delete(unmarhsaled, fieldName) + delete(unmarshaled, fieldName) } if ok { - if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { + if err := unmarshalValue(value, fieldVal, field.Tag); err != nil { return err } } } - keys := make([]string, 0, len(unmarhsaled)) - for k := range unmarhsaled { + keys := make([]string, 0, len(unmarshaled)) + for k := range unmarshaled { keys = append(keys, k) } if len(keys) > 0 { - if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { - return fmt.Errorf("unknown fields: %v", keys) - } - if additionalPropertiesField != nil && additionalPropertiesValue != nil { typeOfMap := additionalPropertiesField.Type if additionalPropertiesValue.Type().Kind() == reflect.Interface { @@ -222,10 +225,10 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool mapValue := reflect.MakeMap(typeOfMap) - for key, value := range unmarhsaled { + for key, value := range unmarshaled { val := reflect.New(typeOfMap.Elem()) - if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { + if err := unmarshalValue(value, val, additionalPropertiesField.Tag); err != nil { return err } @@ -244,7 +247,7 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool } } default: - return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) + return unmarshalValue(b, reflect.ValueOf(v), tag) } return nil @@ -394,7 +397,7 @@ func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.Struc return []byte(tagValue) } -func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { +func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag) error { if bytes.Equal(value, []byte("null")) { if v.CanAddr() { return json.Unmarshal(value, v.Addr().Interface()) @@ -466,18 +469,18 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa } } - var unmarhsaled map[string]json.RawMessage + var unmarshaled map[string]json.RawMessage - if err := json.Unmarshal(value, &unmarhsaled); err != nil { + if err := json.Unmarshal(value, &unmarshaled); err != nil { return err } m := reflect.MakeMap(typ) - for k, value := range unmarhsaled { + for k, value := range unmarshaled { itemVal := reflect.New(typ.Elem()) - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + if err := unmarshalValue(value, itemVal, tag); err != nil { return err } @@ -498,7 +501,7 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa for index, value := range unmarshaled { itemVal := reflect.New(typ.Elem()) - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + if err := unmarshalValue(value, itemVal, tag); err != nil { return err } @@ -616,11 +619,7 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa val = v.Interface() } - d := json.NewDecoder(bytes.NewReader(value)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(val) + return json.Unmarshal(value, val) } func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { diff --git a/internal/utils/retries.go b/internal/utils/retries.go index c045f1e..254e679 100644 --- a/internal/utils/retries.go +++ b/internal/utils/retries.go @@ -7,10 +7,12 @@ import ( "errors" "fmt" "github.com/LukeHagar/plexgo/retry" + "io" "math" "math/rand" "net/http" "net/url" + "slices" "strconv" "strings" "time" @@ -27,6 +29,17 @@ type Retries struct { StatusCodes []string } +var ( + // IETF RFC 7231 4.2 safe and idempotent HTTP methods for connection retries + idempotentHTTPMethods = []string{ + http.MethodDelete, + http.MethodGet, + http.MethodHead, + http.MethodOptions, + http.MethodPut, + } +) + func Retry(ctx context.Context, r Retries, operation func() (*http.Response, error)) (*http.Response, error) { switch r.Config.Strategy { case "backoff": @@ -49,11 +62,48 @@ func Retry(ctx context.Context, r Retries, operation func() (*http.Response, err res, err := operation() if err != nil { + if !r.Config.RetryConnectionErrors { + return retry.Permanent(err) + } + + var httpMethod string + + // Use http.Request method if available + if res != nil && res.Request != nil { + httpMethod = res.Request.Method + } + + isIdempotentHTTPMethod := slices.Contains(idempotentHTTPMethods, httpMethod) urlError := new(url.Error) + if errors.As(err, &urlError) { - if (urlError.Temporary() || urlError.Timeout()) && r.Config.RetryConnectionErrors { + if urlError.Temporary() || urlError.Timeout() { return err } + + // In certain error cases, the http.Request may not have + // been populated, so use url.Error.Op which only has its + // first character capitalized from the original request + // HTTP method. + if httpMethod == "" { + httpMethod = strings.ToUpper(urlError.Op) + } + + isIdempotentHTTPMethod = slices.Contains(idempotentHTTPMethods, httpMethod) + + // Connection closed + if errors.Is(urlError.Err, io.EOF) && isIdempotentHTTPMethod { + return err + } + } + + // syscall detection is not available on every platform, so + // fallback to best effort string detection. + isBrokenPipeError := strings.Contains(err.Error(), "broken pipe") + isConnectionResetError := strings.Contains(err.Error(), "connection reset") + + if (isBrokenPipeError || isConnectionResetError) && isIdempotentHTTPMethod { + return err } return retry.Permanent(err) diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 6f1f538..ea624e7 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -40,8 +40,8 @@ func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}, tag string) if err != nil { return fmt.Errorf("error reading response body: %w", err) } - if err := UnmarshalJSON(data, out, reflect.StructTag(tag), true, false); err != nil { - return fmt.Errorf("error unmarshalling json response body: %w", err) + if err := UnmarshalJSON(data, out, reflect.StructTag(tag), true, nil); err != nil { + return fmt.Errorf("error unmarshaling json response body: %w", err) } return nil diff --git a/models/operations/getalllibraries.go b/models/operations/getalllibraries.go index 072e648..1525058 100644 --- a/models/operations/getalllibraries.go +++ b/models/operations/getalllibraries.go @@ -129,7 +129,7 @@ func (g GetAllLibrariesDirectory) MarshalJSON() ([]byte, error) { } func (g *GetAllLibrariesDirectory) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"allowSync", "art", "composite", "filters", "refreshing", "thumb", "key", "type", "title", "agent", "scanner", "language", "uuid", "updatedAt", "scannedAt", "content", "directory", "contentChangedAt", "Location"}); err != nil { return err } return nil diff --git a/models/operations/getgeodata.go b/models/operations/getgeodata.go index f4b6119..9c07386 100644 --- a/models/operations/getgeodata.go +++ b/models/operations/getgeodata.go @@ -42,7 +42,7 @@ func (g GetGeoDataGeoData) MarshalJSON() ([]byte, error) { } func (g *GetGeoDataGeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { return err } return nil diff --git a/models/operations/getlibrarydetails.go b/models/operations/getlibrarydetails.go index d761d90..8b87d8b 100644 --- a/models/operations/getlibrarydetails.go +++ b/models/operations/getlibrarydetails.go @@ -53,7 +53,7 @@ func (g GetLibraryDetailsRequest) MarshalJSON() ([]byte, error) { } func (g *GetLibraryDetailsRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionKey"}); err != nil { return err } return nil diff --git a/models/operations/getlibraryhubs.go b/models/operations/getlibraryhubs.go index 22c3b7b..e6946fd 100644 --- a/models/operations/getlibraryhubs.go +++ b/models/operations/getlibraryhubs.go @@ -386,7 +386,7 @@ func (g GetLibraryHubsMetadata) MarshalJSON() ([]byte, error) { } func (g *GetLibraryHubsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/getlibraryitems.go b/models/operations/getlibraryitems.go index 1055477..b2c4150 100644 --- a/models/operations/getlibraryitems.go +++ b/models/operations/getlibraryitems.go @@ -153,7 +153,7 @@ func (g GetLibraryItemsRequest) MarshalJSON() ([]byte, error) { } func (g *GetLibraryItemsRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"tag", "type", "sectionKey"}); err != nil { return err } return nil @@ -385,8 +385,8 @@ const ( // GetLibraryItemsOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibraryItemsOptimizedForStreaming struct { - OptimizedForStreaming1 *OptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + OptimizedForStreaming1 *OptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetLibraryItemsOptimizedForStreamingType } @@ -412,14 +412,14 @@ func CreateGetLibraryItemsOptimizedForStreamingBoolean(boolean bool) GetLibraryI func (u *GetLibraryItemsOptimizedForStreaming) UnmarshalJSON(data []byte) error { var optimizedForStreaming1 OptimizedForStreaming1 = OptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &optimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &optimizedForStreaming1, "", true, nil); err == nil { u.OptimizedForStreaming1 = &optimizedForStreaming1 u.Type = GetLibraryItemsOptimizedForStreamingTypeOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibraryItemsOptimizedForStreamingTypeBoolean return nil @@ -475,8 +475,8 @@ const ( // GetLibraryItemsLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibraryItemsLibraryOptimizedForStreaming struct { - GetLibraryItemsOptimizedForStreaming1 *GetLibraryItemsOptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetLibraryItemsOptimizedForStreaming1 *GetLibraryItemsOptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetLibraryItemsLibraryOptimizedForStreamingType } @@ -502,14 +502,14 @@ func CreateGetLibraryItemsLibraryOptimizedForStreamingBoolean(boolean bool) GetL func (u *GetLibraryItemsLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getLibraryItemsOptimizedForStreaming1 GetLibraryItemsOptimizedForStreaming1 = GetLibraryItemsOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getLibraryItemsOptimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getLibraryItemsOptimizedForStreaming1, "", true, nil); err == nil { u.GetLibraryItemsOptimizedForStreaming1 = &getLibraryItemsOptimizedForStreaming1 u.Type = GetLibraryItemsLibraryOptimizedForStreamingTypeGetLibraryItemsOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibraryItemsLibraryOptimizedForStreamingTypeBoolean return nil @@ -592,7 +592,7 @@ func (g GetLibraryItemsPart) MarshalJSON() ([]byte, error) { } func (g *GetLibraryItemsPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { return err } return nil @@ -1460,7 +1460,7 @@ func (g GetLibraryItemsMetadata) MarshalJSON() ([]byte, error) { } func (g *GetLibraryItemsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "banner", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { return err } return nil @@ -2129,7 +2129,7 @@ func (g GetLibraryItemsSort) MarshalJSON() ([]byte, error) { } func (g *GetLibraryItemsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { return err } return nil diff --git a/models/operations/getlibrarysectionsall.go b/models/operations/getlibrarysectionsall.go index cd97089..e5f1173 100644 --- a/models/operations/getlibrarysectionsall.go +++ b/models/operations/getlibrarysectionsall.go @@ -206,7 +206,7 @@ func (g GetLibrarySectionsAllRequest) MarshalJSON() ([]byte, error) { } func (g *GetLibrarySectionsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionKey", "type"}); err != nil { return err } return nil @@ -400,7 +400,7 @@ func (g GetLibrarySectionsAllSort) MarshalJSON() ([]byte, error) { } func (g *GetLibrarySectionsAllSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { return err } return nil @@ -765,8 +765,8 @@ const ( // GetLibrarySectionsAllOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibrarySectionsAllOptimizedForStreaming struct { - GetLibrarySectionsAllOptimizedForStreaming1 *GetLibrarySectionsAllOptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetLibrarySectionsAllOptimizedForStreaming1 *GetLibrarySectionsAllOptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetLibrarySectionsAllOptimizedForStreamingType } @@ -792,14 +792,14 @@ func CreateGetLibrarySectionsAllOptimizedForStreamingBoolean(boolean bool) GetLi func (u *GetLibrarySectionsAllOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreaming1 = GetLibrarySectionsAllOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreaming1, "", true, nil); err == nil { u.GetLibrarySectionsAllOptimizedForStreaming1 = &getLibrarySectionsAllOptimizedForStreaming1 u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeBoolean return nil @@ -855,8 +855,8 @@ const ( // GetLibrarySectionsAllLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibrarySectionsAllLibraryOptimizedForStreaming struct { - GetLibrarySectionsAllOptimizedForStreamingLibrary1 *GetLibrarySectionsAllOptimizedForStreamingLibrary1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetLibrarySectionsAllOptimizedForStreamingLibrary1 *GetLibrarySectionsAllOptimizedForStreamingLibrary1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetLibrarySectionsAllLibraryOptimizedForStreamingType } @@ -882,14 +882,14 @@ func CreateGetLibrarySectionsAllLibraryOptimizedForStreamingBoolean(boolean bool func (u *GetLibrarySectionsAllLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllOptimizedForStreamingLibrary1 = GetLibrarySectionsAllOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreamingLibrary1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreamingLibrary1, "", true, nil); err == nil { u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 = &getLibrarySectionsAllOptimizedForStreamingLibrary1 u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean return nil @@ -1046,7 +1046,7 @@ func (g GetLibrarySectionsAllStream) MarshalJSON() ([]byte, error) { } func (g *GetLibrarySectionsAllStream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil { return err } return nil @@ -1442,7 +1442,7 @@ func (g GetLibrarySectionsAllPart) MarshalJSON() ([]byte, error) { } func (g *GetLibrarySectionsAllPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "key", "file", "size"}); err != nil { return err } return nil @@ -1931,7 +1931,7 @@ func (g GetLibrarySectionsAllMetadata) MarshalJSON() ([]byte, error) { } func (g *GetLibrarySectionsAllMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { return err } return nil diff --git a/models/operations/getmediametadata.go b/models/operations/getmediametadata.go index 472901b..d3e7060 100644 --- a/models/operations/getmediametadata.go +++ b/models/operations/getmediametadata.go @@ -283,8 +283,8 @@ const ( // GetMediaMetaDataOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetMediaMetaDataOptimizedForStreaming struct { - GetMediaMetaDataOptimizedForStreaming1 *GetMediaMetaDataOptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetMediaMetaDataOptimizedForStreaming1 *GetMediaMetaDataOptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetMediaMetaDataOptimizedForStreamingType } @@ -310,14 +310,14 @@ func CreateGetMediaMetaDataOptimizedForStreamingBoolean(boolean bool) GetMediaMe func (u *GetMediaMetaDataOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getMediaMetaDataOptimizedForStreaming1 GetMediaMetaDataOptimizedForStreaming1 = GetMediaMetaDataOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreaming1, "", true, nil); err == nil { u.GetMediaMetaDataOptimizedForStreaming1 = &getMediaMetaDataOptimizedForStreaming1 u.Type = GetMediaMetaDataOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetMediaMetaDataOptimizedForStreamingTypeBoolean return nil @@ -373,8 +373,8 @@ const ( // GetMediaMetaDataLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetMediaMetaDataLibraryOptimizedForStreaming struct { - GetMediaMetaDataOptimizedForStreamingLibrary1 *GetMediaMetaDataOptimizedForStreamingLibrary1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetMediaMetaDataOptimizedForStreamingLibrary1 *GetMediaMetaDataOptimizedForStreamingLibrary1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetMediaMetaDataLibraryOptimizedForStreamingType } @@ -400,14 +400,14 @@ func CreateGetMediaMetaDataLibraryOptimizedForStreamingBoolean(boolean bool) Get func (u *GetMediaMetaDataLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getMediaMetaDataOptimizedForStreamingLibrary1 GetMediaMetaDataOptimizedForStreamingLibrary1 = GetMediaMetaDataOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreamingLibrary1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getMediaMetaDataOptimizedForStreamingLibrary1, "", true, nil); err == nil { u.GetMediaMetaDataOptimizedForStreamingLibrary1 = &getMediaMetaDataOptimizedForStreamingLibrary1 u.Type = GetMediaMetaDataLibraryOptimizedForStreamingTypeGetMediaMetaDataOptimizedForStreamingLibrary1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetMediaMetaDataLibraryOptimizedForStreamingTypeBoolean return nil @@ -564,7 +564,7 @@ func (g GetMediaMetaDataStream) MarshalJSON() ([]byte, error) { } func (g *GetMediaMetaDataStream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "streamType"}); err != nil { return err } return nil @@ -960,7 +960,7 @@ func (g GetMediaMetaDataPart) MarshalJSON() ([]byte, error) { } func (g *GetMediaMetaDataPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { return err } return nil @@ -1880,7 +1880,7 @@ func (g GetMediaMetaDataMetadata) MarshalJSON() ([]byte, error) { } func (g *GetMediaMetaDataMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { return err } return nil diff --git a/models/operations/getpin.go b/models/operations/getpin.go index 5ce24e7..5a2b64d 100644 --- a/models/operations/getpin.go +++ b/models/operations/getpin.go @@ -35,7 +35,7 @@ func (g GetPinRequest) MarshalJSON() ([]byte, error) { } func (g *GetPinRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"X-Plex-Client-Identifier"}); err != nil { return err } return nil @@ -114,7 +114,7 @@ func (g GeoData) MarshalJSON() ([]byte, error) { } func (g *GeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { return err } return nil @@ -221,7 +221,7 @@ func (g GetPinAuthPinContainer) MarshalJSON() ([]byte, error) { } func (g *GetPinAuthPinContainer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "code", "product", "qr", "clientIdentifier", "location", "createdAt", "expiresAt"}); err != nil { return err } return nil diff --git a/models/operations/getplaylistcontents.go b/models/operations/getplaylistcontents.go index 3a37acb..acbc9b3 100644 --- a/models/operations/getplaylistcontents.go +++ b/models/operations/getplaylistcontents.go @@ -376,7 +376,7 @@ func (g GetPlaylistContentsMetadata) MarshalJSON() ([]byte, error) { } func (g *GetPlaylistContentsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/getrecentlyadded.go b/models/operations/getrecentlyadded.go index 8173ddf..416afc5 100644 --- a/models/operations/getrecentlyadded.go +++ b/models/operations/getrecentlyadded.go @@ -97,7 +97,7 @@ func (g GetRecentlyAddedRequest) MarshalJSON() ([]byte, error) { } func (g *GetRecentlyAddedRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"contentDirectoryID", "type"}); err != nil { return err } return nil @@ -277,7 +277,7 @@ func (g GetRecentlyAddedSort) MarshalJSON() ([]byte, error) { } func (g *GetRecentlyAddedSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { return err } return nil @@ -642,8 +642,8 @@ const ( // OptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type OptimizedForStreaming struct { - One *One `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + One *One `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type OptimizedForStreamingType } @@ -669,14 +669,14 @@ func CreateOptimizedForStreamingBoolean(boolean bool) OptimizedForStreaming { func (u *OptimizedForStreaming) UnmarshalJSON(data []byte) error { var one One = One(0) - if err := utils.UnmarshalJSON(data, &one, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &one, "", true, nil); err == nil { u.One = &one u.Type = OptimizedForStreamingTypeOne return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = OptimizedForStreamingTypeBoolean return nil @@ -732,8 +732,8 @@ const ( // GetRecentlyAddedOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetRecentlyAddedOptimizedForStreaming struct { - GetRecentlyAddedOptimizedForStreaming1 *GetRecentlyAddedOptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetRecentlyAddedOptimizedForStreaming1 *GetRecentlyAddedOptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetRecentlyAddedOptimizedForStreamingType } @@ -759,14 +759,14 @@ func CreateGetRecentlyAddedOptimizedForStreamingBoolean(boolean bool) GetRecentl func (u *GetRecentlyAddedOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreaming1 = GetRecentlyAddedOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getRecentlyAddedOptimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getRecentlyAddedOptimizedForStreaming1, "", true, nil); err == nil { u.GetRecentlyAddedOptimizedForStreaming1 = &getRecentlyAddedOptimizedForStreaming1 u.Type = GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetRecentlyAddedOptimizedForStreamingTypeBoolean return nil @@ -923,7 +923,7 @@ func (s Stream) MarshalJSON() ([]byte, error) { } func (s *Stream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil { return err } return nil @@ -1319,7 +1319,7 @@ func (p Part) MarshalJSON() ([]byte, error) { } func (p *Part) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "key", "file", "size"}); err != nil { return err } return nil @@ -2105,7 +2105,7 @@ func (g GetRecentlyAddedMetadata) MarshalJSON() ([]byte, error) { } func (g *GetRecentlyAddedMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"addedAt", "art", "audienceRating", "childCount", "duration", "guid", "index", "key", "parentStudio", "parentTheme", "ratingKey", "rating", "seasonCount", "slug", "summary", "tagline", "theme", "thumb", "titleSort", "title", "type"}); err != nil { return err } return nil diff --git a/models/operations/getrecentlyaddedlibrary.go b/models/operations/getrecentlyaddedlibrary.go index 055ab13..9dea51b 100644 --- a/models/operations/getrecentlyaddedlibrary.go +++ b/models/operations/getrecentlyaddedlibrary.go @@ -94,7 +94,7 @@ func (g GetRecentlyAddedLibraryRequest) MarshalJSON() ([]byte, error) { } func (g *GetRecentlyAddedLibraryRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { return err } return nil @@ -274,7 +274,7 @@ func (s Sort) MarshalJSON() ([]byte, error) { } func (s *Sort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &s, "", false, []string{"key", "title"}); err != nil { return err } return nil @@ -785,7 +785,7 @@ func (g GetRecentlyAddedLibraryMetadata) MarshalJSON() ([]byte, error) { } func (g *GetRecentlyAddedLibraryMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/getresizedphoto.go b/models/operations/getresizedphoto.go index 9630e9e..9f385ec 100644 --- a/models/operations/getresizedphoto.go +++ b/models/operations/getresizedphoto.go @@ -85,7 +85,7 @@ func (g GetResizedPhotoRequest) MarshalJSON() ([]byte, error) { } func (g *GetResizedPhotoRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"width", "height", "opacity", "blur", "minSize", "upscale", "url"}); err != nil { return err } return nil diff --git a/models/operations/getsearchalllibraries.go b/models/operations/getsearchalllibraries.go index a58410a..fde92c8 100644 --- a/models/operations/getsearchalllibraries.go +++ b/models/operations/getsearchalllibraries.go @@ -100,7 +100,7 @@ func (g GetSearchAllLibrariesRequest) MarshalJSON() ([]byte, error) { } func (g *GetSearchAllLibrariesRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"query", "X-Plex-Client-Identifier"}); err != nil { return err } return nil @@ -179,7 +179,7 @@ func (g GetSearchAllLibrariesDirectory) MarshalJSON() ([]byte, error) { } func (g *GetSearchAllLibrariesDirectory) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "librarySectionID", "librarySectionKey", "librarySectionTitle", "type", "id", "tag"}); err != nil { return err } return nil @@ -447,8 +447,8 @@ const ( // GetSearchAllLibrariesOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetSearchAllLibrariesOptimizedForStreaming struct { - GetSearchAllLibrariesOptimizedForStreaming1 *GetSearchAllLibrariesOptimizedForStreaming1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetSearchAllLibrariesOptimizedForStreaming1 *GetSearchAllLibrariesOptimizedForStreaming1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetSearchAllLibrariesOptimizedForStreamingType } @@ -474,14 +474,14 @@ func CreateGetSearchAllLibrariesOptimizedForStreamingBoolean(boolean bool) GetSe func (u *GetSearchAllLibrariesOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getSearchAllLibrariesOptimizedForStreaming1 GetSearchAllLibrariesOptimizedForStreaming1 = GetSearchAllLibrariesOptimizedForStreaming1(0) - if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreaming1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreaming1, "", true, nil); err == nil { u.GetSearchAllLibrariesOptimizedForStreaming1 = &getSearchAllLibrariesOptimizedForStreaming1 u.Type = GetSearchAllLibrariesOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreaming1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetSearchAllLibrariesOptimizedForStreamingTypeBoolean return nil @@ -537,8 +537,8 @@ const ( // GetSearchAllLibrariesLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetSearchAllLibrariesLibraryOptimizedForStreaming struct { - GetSearchAllLibrariesOptimizedForStreamingLibrary1 *GetSearchAllLibrariesOptimizedForStreamingLibrary1 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` + GetSearchAllLibrariesOptimizedForStreamingLibrary1 *GetSearchAllLibrariesOptimizedForStreamingLibrary1 `queryParam:"inline" name:"optimizedForStreaming"` + Boolean *bool `queryParam:"inline" name:"optimizedForStreaming"` Type GetSearchAllLibrariesLibraryOptimizedForStreamingType } @@ -564,14 +564,14 @@ func CreateGetSearchAllLibrariesLibraryOptimizedForStreamingBoolean(boolean bool func (u *GetSearchAllLibrariesLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getSearchAllLibrariesOptimizedForStreamingLibrary1 GetSearchAllLibrariesOptimizedForStreamingLibrary1 = GetSearchAllLibrariesOptimizedForStreamingLibrary1(0) - if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreamingLibrary1, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &getSearchAllLibrariesOptimizedForStreamingLibrary1, "", true, nil); err == nil { u.GetSearchAllLibrariesOptimizedForStreamingLibrary1 = &getSearchAllLibrariesOptimizedForStreamingLibrary1 u.Type = GetSearchAllLibrariesLibraryOptimizedForStreamingTypeGetSearchAllLibrariesOptimizedForStreamingLibrary1 return nil } var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetSearchAllLibrariesLibraryOptimizedForStreamingTypeBoolean return nil @@ -654,7 +654,7 @@ func (g GetSearchAllLibrariesPart) MarshalJSON() ([]byte, error) { } func (g *GetSearchAllLibrariesPart) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id"}); err != nil { return err } return nil @@ -1249,7 +1249,7 @@ func (g GetSearchAllLibrariesMetadata) MarshalJSON() ([]byte, error) { } func (g *GetSearchAllLibrariesMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "banner", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { return err } return nil diff --git a/models/operations/getsearchresults.go b/models/operations/getsearchresults.go index 3ed2aa5..e68bf59 100644 --- a/models/operations/getsearchresults.go +++ b/models/operations/getsearchresults.go @@ -307,7 +307,7 @@ func (g GetSearchResultsMetadata) MarshalJSON() ([]byte, error) { } func (g *GetSearchResultsMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/getserverresources.go b/models/operations/getserverresources.go index 7956f8d..0ab978f 100644 --- a/models/operations/getserverresources.go +++ b/models/operations/getserverresources.go @@ -114,7 +114,7 @@ func (g GetServerResourcesRequest) MarshalJSON() ([]byte, error) { } func (g *GetServerResourcesRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"X-Plex-Client-Identifier"}); err != nil { return err } return nil @@ -274,7 +274,7 @@ func (p PlexDevice) MarshalJSON() ([]byte, error) { } func (p *PlexDevice) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"name", "product", "productVersion", "platform", "platformVersion", "device", "clientIdentifier", "createdAt", "lastSeenAt", "provides", "ownerId", "sourceTitle", "publicAddress", "accessToken", "owned", "home", "synced", "relay", "presence", "httpsRequired", "publicAddressMatches", "dnsRebindingProtection", "natLoopbackSupported", "connections"}); err != nil { return err } return nil diff --git a/models/operations/getsessionhistory.go b/models/operations/getsessionhistory.go index cee8a5c..b48f4a9 100644 --- a/models/operations/getsessionhistory.go +++ b/models/operations/getsessionhistory.go @@ -84,7 +84,7 @@ func (g GetSessionHistoryMetadata) MarshalJSON() ([]byte, error) { } func (g *GetSessionHistoryMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/gettokenbypinid.go b/models/operations/gettokenbypinid.go index 7d275c7..a68c404 100644 --- a/models/operations/gettokenbypinid.go +++ b/models/operations/gettokenbypinid.go @@ -100,7 +100,7 @@ func (g GetTokenByPinIDGeoData) MarshalJSON() ([]byte, error) { } func (g *GetTokenByPinIDGeoData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil { return err } return nil @@ -207,7 +207,7 @@ func (g GetTokenByPinIDAuthPinContainer) MarshalJSON() ([]byte, error) { } func (g *GetTokenByPinIDAuthPinContainer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "code", "product", "qr", "clientIdentifier", "location", "createdAt", "expiresAt"}); err != nil { return err } return nil diff --git a/models/operations/gettokendetails.go b/models/operations/gettokendetails.go index a888b1e..5448c02 100644 --- a/models/operations/gettokendetails.go +++ b/models/operations/gettokendetails.go @@ -179,7 +179,7 @@ func (u UserProfile) MarshalJSON() ([]byte, error) { } func (u *UserProfile) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"defaultAudioLanguage", "defaultSubtitleLanguage"}); err != nil { return err } return nil @@ -521,7 +521,7 @@ func (g GetTokenDetailsUserPlexAccount) MarshalJSON() ([]byte, error) { } func (g *GetTokenDetailsUserPlexAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"adsConsent", "adsConsentReminderAt", "adsConsentSetAt", "authToken", "country", "email", "friendlyName", "entitlements", "homeSize", "id", "joinedAt", "locale", "mailingListStatus", "maxHomeSize", "profile", "rememberExpiresAt", "scrobbleTypes", "services", "subscription", "subscriptionDescription", "thumb", "title", "username", "uuid", "attributionPartner"}); err != nil { return err } return nil diff --git a/models/operations/gettopwatchedcontent.go b/models/operations/gettopwatchedcontent.go index fd31b3f..fa864df 100644 --- a/models/operations/gettopwatchedcontent.go +++ b/models/operations/gettopwatchedcontent.go @@ -80,7 +80,7 @@ func (g GetTopWatchedContentRequest) MarshalJSON() ([]byte, error) { } func (g *GetTopWatchedContentRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { return err } return nil @@ -267,7 +267,7 @@ func (g GetTopWatchedContentMetadata) MarshalJSON() ([]byte, error) { } func (g *GetTopWatchedContentMetadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/getuserfriends.go b/models/operations/getuserfriends.go index ad00e98..00eac1d 100644 --- a/models/operations/getuserfriends.go +++ b/models/operations/getuserfriends.go @@ -58,7 +58,7 @@ func (f Friend) MarshalJSON() ([]byte, error) { } func (f *Friend) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &f, "", false, []string{"email", "friendlyName", "home", "id", "sharedServers", "sharedSources", "status", "thumb", "title", "username", "uuid"}); err != nil { return err } return nil diff --git a/models/operations/getusers.go b/models/operations/getusers.go index 621e9ff..62da8b7 100644 --- a/models/operations/getusers.go +++ b/models/operations/getusers.go @@ -452,7 +452,7 @@ func (g GetUsersServer) MarshalJSON() ([]byte, error) { } func (g *GetUsersServer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "serverId", "machineIdentifier", "name", "lastSeenAt", "numLibraries"}); err != nil { return err } return nil @@ -561,7 +561,7 @@ func (u User) MarshalJSON() ([]byte, error) { } func (u *User) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"id", "title", "username", "email", "thumb", "Server"}); err != nil { return err } return nil diff --git a/models/operations/getwatchlist.go b/models/operations/getwatchlist.go index 29238fd..9c504ab 100644 --- a/models/operations/getwatchlist.go +++ b/models/operations/getwatchlist.go @@ -11,7 +11,7 @@ import ( ) var GetWatchListServerList = []string{ - "https://metadata.provider.plex.tv", + "https://discover.provider.plex.tv", } // Filter @@ -133,7 +133,7 @@ func (g GetWatchListRequest) MarshalJSON() ([]byte, error) { } func (g *GetWatchListRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"filter", "X-Plex-Token"}); err != nil { return err } return nil @@ -272,7 +272,7 @@ func (m Metadata) MarshalJSON() ([]byte, error) { } func (m *Metadata) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { return err } return nil diff --git a/models/operations/performsearch.go b/models/operations/performsearch.go index b0ab93e..55152c5 100644 --- a/models/operations/performsearch.go +++ b/models/operations/performsearch.go @@ -21,7 +21,7 @@ func (p PerformSearchRequest) MarshalJSON() ([]byte, error) { } func (p *PerformSearchRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"query"}); err != nil { return err } return nil diff --git a/models/operations/performvoicesearch.go b/models/operations/performvoicesearch.go index a4f9c63..c4ab946 100644 --- a/models/operations/performvoicesearch.go +++ b/models/operations/performvoicesearch.go @@ -21,7 +21,7 @@ func (p PerformVoiceSearchRequest) MarshalJSON() ([]byte, error) { } func (p *PerformVoiceSearchRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"query"}); err != nil { return err } return nil diff --git a/models/operations/postuserssignindata.go b/models/operations/postuserssignindata.go index 3b3dd55..e7fbdb1 100644 --- a/models/operations/postuserssignindata.go +++ b/models/operations/postuserssignindata.go @@ -26,7 +26,7 @@ func (p PostUsersSignInDataRequestBody) MarshalJSON() ([]byte, error) { } func (p *PostUsersSignInDataRequestBody) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"login", "password"}); err != nil { return err } return nil @@ -283,7 +283,7 @@ func (p PostUsersSignInDataUserProfile) MarshalJSON() ([]byte, error) { } func (p *PostUsersSignInDataUserProfile) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"defaultAudioLanguage", "defaultSubtitleLanguage"}); err != nil { return err } return nil @@ -593,7 +593,7 @@ func (p PastSubscription) MarshalJSON() ([]byte, error) { } func (p *PastSubscription) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "mode", "renewsAt", "endsAt", "type", "transfer", "state", "billing"}); err != nil { return err } return nil @@ -796,7 +796,7 @@ func (p PostUsersSignInDataUserPlexAccount) MarshalJSON() ([]byte, error) { } func (p *PostUsersSignInDataUserPlexAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"adsConsent", "adsConsentReminderAt", "adsConsentSetAt", "authToken", "country", "email", "friendlyName", "entitlements", "homeSize", "id", "joinedAt", "locale", "mailingListStatus", "maxHomeSize", "profile", "rememberExpiresAt", "scrobbleTypes", "services", "subscription", "subscriptionDescription", "thumb", "title", "username", "uuid", "attributionPartner", "pastSubscriptions", "trials"}); err != nil { return err } return nil diff --git a/models/operations/uploadplaylist.go b/models/operations/uploadplaylist.go index 4f4fb21..a6539f3 100644 --- a/models/operations/uploadplaylist.go +++ b/models/operations/uploadplaylist.go @@ -63,7 +63,7 @@ func (u UploadPlaylistRequest) MarshalJSON() ([]byte, error) { } func (u *UploadPlaylistRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { + if err := utils.UnmarshalJSON(data, &u, "", false, []string{"path", "force", "sectionID"}); err != nil { return err } return nil diff --git a/plexapi.go b/plexapi.go index 2e92e67..7b9f70a 100644 --- a/plexapi.go +++ b/plexapi.go @@ -2,7 +2,7 @@ package plexgo -// Generated from OpenAPI doc version 0.0.3 and generator version 2.674.3 +// Generated from OpenAPI doc version 0.0.3 and generator version 2.698.4 import ( "context" @@ -277,9 +277,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *PlexAPI { sdk := &PlexAPI{ - SDKVersion: "0.24.1", + SDKVersion: "0.24.2", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.24.1 2.674.3 0.0.3 github.com/LukeHagar/plexgo", + UserAgent: "speakeasy-sdk/go 0.24.2 2.698.4 0.0.3 github.com/LukeHagar/plexgo", ServerList: ServerList, ServerVariables: []map[string]string{ {