Compare commits

...

3 Commits

Author SHA1 Message Date
speakeasybot
484b48c271 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.615.2 2025-09-16 00:11:29 +00:00
speakeasybot
06ae97fe29 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.3 2025-08-07 00:13:14 +00:00
speakeasybot
5848325f97 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.0 2025-08-06 00:13:08 +00:00
55 changed files with 597 additions and 162 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.env
.env.local
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/

View File

@@ -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.558.1
generationVersion: 2.623.4
releaseVersion: 0.23.0
configChecksum: d22250392b9bf523127b982981e4f99a
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.8.0
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.83.3
retries: 2.84.2
sdkHooks: 0.2.0
unions: 2.85.10
unions: 2.85.14
uploadStreams: 0.1.0
generatedFiles:
- .gitattributes
@@ -1297,6 +1297,17 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-update-play-progress:
parameters:
query:
key: "<key>"
time: 90000
state: "played"
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-banner-image:
speakeasy-default-get-banner-image:
parameters:
@@ -1354,6 +1365,24 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-timeline:
parameters:
query:
ratingKey: 23409
key: "/library/metadata/23409"
state: "playing"
hasMDE: 1
time: 2000
duration: 10000
context: "home:hub.continueWatching"
playQueueItemID: 1
playBackTime: 2000
row: 1
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
startUniversalTranscode:
"":
parameters:
@@ -1379,6 +1408,30 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-start-universal-transcode:
parameters:
query:
hasMDE: 1
path: "/library/metadata/23409"
mediaIndex: 0
partIndex: 0
protocol: "hls"
fastSeek: 0
directPlay: 0
directStream: 0
subtitleSize: 100
subtites: "burn"
audioBoost: 100
location: "lan"
mediaBufferSize: 102400
session: "zvcage8b7rkioqcm8f4uns4c"
addDebugOverlay: 0
autoAdjustQuality: 0
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getServerActivities:
speakeasy-default-get-server-activities:
responses:
@@ -1398,6 +1451,15 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-cancel-server-activities:
parameters:
path:
activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e"
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getButlerTasks:
speakeasy-default-get-butler-tasks:
responses:
@@ -1493,6 +1555,21 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-server-resources:
parameters:
query:
includeHttps: 1
includeRelay: 1
includeIPv6: 1
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
responses:
"200":
application/json: [{"name": "<value>", "product": "Ergonomic Plastic Hat", "productVersion": "<value>", "platform": "<value>", "platformVersion": "<value>", "device": "Mobile", "clientIdentifier": "<value>", "createdAt": "2019-06-24T11:38:02Z", "lastSeenAt": "2019-06-24T11:38:02Z", "provides": "<value>", "ownerId": null, "sourceTitle": "<value>", "publicAddress": "<value>", "accessToken": "<value>", "owned": true, "home": false, "synced": false, "relay": true, "presence": false, "httpsRequired": true, "publicAddressMatches": false, "dnsRebindingProtection": true, "natLoopbackSupported": false, "connections": [{"protocol": "http", "address": "5746 Mount Street", "port": 441996, "uri": "https://wide-kick.name/", "local": false, "relay": true, "IPv6": true}]}]
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getPin:
"":
parameters:
@@ -1509,6 +1586,21 @@ examples:
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
speakeasy-default-get-pin:
parameters:
query:
strong: false
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
responses:
"201":
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
getTokenByPinId:
"":
parameters:
@@ -1523,6 +1615,23 @@ examples:
responses:
"404":
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
speakeasy-default-get-token-by-pin-id:
parameters:
path:
pinID: 232248
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
responses:
"200":
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"404":
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
getGlobalHubs:
speakeasy-default-get-global-hubs:
responses:
@@ -1777,6 +1886,22 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-search-all-libraries:
parameters:
query:
query: "<value>"
searchTypes: ["people"]
includeCollections: 1
includeExternalMedia: 1
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
responses:
"200":
application/json: {"MediaContainer": {"size": 50, "allowSync": false, "identifier": "com.plexapp.plugins.library", "librarySectionID": 2, "librarySectionTitle": "TV Series", "librarySectionUUID": "e69655a2-ef48-4aba-bb19-0cc34d1e7d36", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "SearchResult": [{"score": 0.92, "Directory": {"key": "/library/sections/3/all?actor=197429", "librarySectionID": 1, "librarySectionKey": "/library/sections/1", "librarySectionTitle": "Movies", "librarySectionType": 1, "type": "tag", "id": 197429, "filter": "actor=197429", "tag": "Ben Stiller", "tagType": 4, "tagKey": "5d776826999c64001ec2c606", "thumb": "https://metadata-static.plex.tv/5/people/57bd7c7d6c5c9e2881251b30e5603d3d.jpg", "count": 10}, "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "slug": "4-for-texas", "studio": "20th Century Studios", "type": "movie", "title": "Avatar: The Way of Water", "banner": "/library/metadata/58683/banner/1703239236", "titleSort": "Whale", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.\nOnce a familiar threat returns to finish what was previously started, Jake must\nwork with Neytiri and the army of the Na'vi race to protect their home.\n", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "tagline": "Return to Pandora.", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "theme": "/library/metadata/1/theme/1705636920", "index": 1, "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "seasonCount": 2022, "duration": 11558112, "originallyAvailableAt": "2022-12-14", "addedAt": 1556281940, "updatedAt": 1556281940, "parentYear": 2010, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "parentRatingKey": "66", "grandparentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/66", "parentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "grandparentArt": "/library/metadata/66/art/1705716261", "parentTitle": "Caprica", "parentIndex": 1, "parentThumb": "/library/metadata/66/thumb/1705716261", "ratingImage": "rottentomatoes://image.rating.ripe", "viewCount": 1, "viewOffset": 5222500, "skipCount": 1, "subtype": "clip", "lastRatedAt": 1721813113, "createdAtAccuracy": "epoch,local", "createdAtTZOffset": "0", "lastViewedAt": 1682752242, "userRating": 10, "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Guid": [{"id": "{\"imdbExample\":{\"summary\":\"IMDB example\",\"value\":\"imdb://tt13015952\"},\"tmdbExample\":{\"summary\":\"TMDB example\",\"value\":\"tmdb://2434012\"},\"tvdbExample\":{\"summary\":\"TVDB example\",\"value\":\"tvdb://7945991\"}}"}], "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "showOrdering": "absolute", "flattenSeasons": "1", "skipChildren": false, "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "aac", "videoCodec": "hevc", "videoResolution": "4k", "container": "mp4", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1"}]}], "Genre": [{"id": 259, "tag": "Crime"}], "Country": [{"id": 259, "tag": "United States of America"}], "Director": [{"id": 126522, "tag": "Danny Boyle", "thumb": "https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg"}], "Writer": [{"id": 126522, "tag": "Jamie P. Hanson", "thumb": "https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg"}], "Role": [{"id": 126522, "tag": "Teller", "role": "Self - Judge", "thumb": "https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg"}], "Location": [{"path": "/TV Shows/Clarkson's Farm"}]}}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-media-meta-data:
speakeasy-default-get-media-meta-data:
parameters:
@@ -2086,6 +2211,23 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-post-users-sign-in-data:
parameters:
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
requestBody:
application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "rememberMe": false, "verificationCode": "123456"}
responses:
"201":
application/json: {"adsConsent": null, "adsConsentReminderAt": 1556281940, "adsConsentSetAt": 1556281940, "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": "ru", "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "scrobbleTypes": "<value>", "services": [], "subscription": {"active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive"}, "subscriptionDescription": "<value>", "subscriptions": [{"active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null, "pastSubscriptions": [], "trials": []}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getStatistics:
"":
parameters:
@@ -2098,6 +2240,17 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-statistics:
parameters:
query:
timespan: 4
responses:
"200":
application/json: {"MediaContainer": {"size": 5497, "Device": [{"id": 208, "name": "Roku Express", "platform": "Roku", "clientIdentifier": "793095d235660625108ef785cc7646e9", "createdAt": 1706470556}], "Account": [{"id": 238960586, "key": "/accounts/238960586", "name": "Diane", "defaultAudioLanguage": "en", "autoSelectAudio": true, "defaultSubtitleLanguage": "en", "subtitleMode": 1, "thumb": "https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}], "StatisticsMedia": [{"accountID": 1, "deviceID": 13, "timespan": 4, "at": 1707141600, "metadataType": 4, "count": 1, "duration": 1555}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getResourcesStatistics:
"":
parameters:
@@ -2110,6 +2263,17 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-resources-statistics:
parameters:
query:
timespan: 4
responses:
"200":
application/json: {"MediaContainer": {"size": 5497, "StatisticsResources": [{"timespan": 6, "at": 1718384427, "hostCpuUtilization": 1.276, "processCpuUtilization": 0.025, "hostMemoryUtilization": 17.026, "processMemoryUtilization": 0.493}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getBandwidthStatistics:
"":
parameters:
@@ -2122,6 +2286,17 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-bandwidth-statistics:
parameters:
query:
timespan: 4
responses:
"200":
application/json: {"MediaContainer": {"size": 5497, "Device": [{"id": 208, "name": "Roku Express", "platform": "Roku", "clientIdentifier": "793095d235660625108ef785cc7646e9", "createdAt": 1706470556}], "Account": [{"id": 238960586, "key": "/accounts/238960586", "name": "Diane", "defaultAudioLanguage": "en", "autoSelectAudio": true, "defaultSubtitleLanguage": "en", "subtitleMode": 1, "thumb": "https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}], "StatisticsBandwidth": [{"accountID": 238960586, "deviceID": 208, "timespan": 6, "at": 1718387650, "lan": true, "bytes": 22}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getSessions:
speakeasy-default-get-sessions:
responses:
@@ -2214,6 +2389,19 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-session-history:
parameters:
query:
accountId: 1
filter: {}
librarySectionID: 12
responses:
"200":
application/json: {"MediaContainer": {"size": 10855, "Metadata": [{"historyKey": "/status/sessions/history/1", "key": "/library/metadata/32171", "ratingKey": "32171", "librarySectionID": "2", "parentKey": "/library/metadata/32170", "grandparentKey": "/library/metadata/32132", "title": "The Noise That Blue Makes", "grandparentTitle": "Taskmaster", "type": "episode", "thumb": "/library/metadata/32171/thumb/-1", "parentThumb": "/library/metadata/32170/thumb/1654134301", "grandparentThumb": "/library/metadata/32132/thumb/1703933346", "grandparentArt": "/library/metadata/32132/art/1703933346", "index": 1, "parentIndex": 13, "originallyAvailableAt": "2022-04-14T00:00:00Z", "viewedAt": 1654139223, "accountID": 1, "deviceID": 5}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getTranscodeSessions:
speakeasy-default-get-transcode-sessions:
responses:
@@ -2252,6 +2440,15 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-check-for-updates:
parameters:
query:
download: 1
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
applyUpdates:
"":
parameters:
@@ -2263,6 +2460,16 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-apply-updates:
parameters:
query:
tonight: 1
skip: 1
responses:
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-users:
"":
parameters:
@@ -2287,5 +2494,28 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
speakeasy-default-get-users:
parameters:
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Device-Name: "Chrome"
X-Plex-Device-Screen-Resolution: "1487x1165,2560x1440"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
X-Plex-Features: "external-media,indirect-media,hub-style-list"
X-Plex-Model: "4200X"
X-Plex-Session-Id: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"
X-Plex-Language: "en"
X-Plex-Platform-Version: "4.3 build 1057"
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"200":
application/xml: "0xfD5052DbD1"
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
examplesVersion: 1.0.2
generatedTests: {}

View File

@@ -16,8 +16,13 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
go:
version: 0.23.0
version: 0.24.2
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
baseErrorName: PlexAPIError
@@ -35,6 +40,9 @@ go:
inputModelSuffix: input
maxMethodParams: 4
methodArguments: require-security-and-request
modulePath: ""
outputModelSuffix: output
packageName: github.com/LukeHagar/plexgo
respectRequiredFields: false
responseFormat: envelope
sdkPackageName: ""

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.558.1
speakeasyVersion: 1.615.2
sources:
my-source:
sourceNamespace: my-source
@@ -9,19 +9,19 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
tags:
- latest
- speakeasy-sdk-regen-1749514263
- speakeasy-sdk-regen-1757981413
targets:
plexgo:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
codeSamplesNamespace: code-samples-go-plexgo
codeSamplesRevisionDigest: sha256:3b03148d4d6862182c93ca6cb369128309b007a961711d86509a555a2c5d813d
codeSamplesRevisionDigest: sha256:918f406f027ab1b34a6256235e3389f56c35fa6b319855542a8c2bccc8c97e1a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -519,12 +519,13 @@ The built-in `net/http` client satisfies this interface and a default client bas
import (
"net/http"
"time"
"github.com/myorg/your-go-sdk"
"github.com/LukeHagar/plexgo"
)
var (
httpClient = &http.Client{Timeout: 30 * time.Second}
sdkClient = sdk.New(sdk.WithClient(httpClient))
sdkClient = plexgo.New(plexgo.WithClient(httpClient))
)
```

View File

@@ -1173,3 +1173,33 @@ Based on:
- [go v0.23.0] .
### Releases
- [Go v0.23.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.23.0 - .
## 2025-08-06 00:11:40
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.598.0 (2.674.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.24.0] .
### Releases
- [Go v0.24.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.24.0 - .
## 2025-08-07 00:11:47
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.598.3 (2.674.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.24.1] .
### Releases
- [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 - .

View File

@@ -795,7 +795,7 @@ actions:
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetFileHash(ctx, "file://C:\Image.png&type=13", nil)
res, err := s.Library.GetFileHash(ctx, "file://C:\\Image.png&type=13", nil)
if err != nil {
log.Fatal(err)
}

View File

@@ -23,6 +23,7 @@ Get Server Activities
### Example Usage
<!-- UsageSnippet language="go" operationID="getServerActivities" method="get" path="/activities" -->
```go
package main
@@ -74,6 +75,7 @@ Cancel Server Activities
### Example Usage
<!-- UsageSnippet language="go" operationID="cancelServerActivities" method="delete" path="/activities/{activityUUID}" -->
```go
package main

View File

@@ -20,6 +20,7 @@ This endpoint provides the caller with a temporary token with the same access le
### Example Usage
<!-- UsageSnippet language="go" operationID="getTransientToken" method="get" path="/security/token" -->
```go
package main
@@ -76,6 +77,7 @@ Note: requires Plex Media Server >= 1.15.4.
### Example Usage
<!-- UsageSnippet language="go" operationID="getSourceConnectionInformation" method="get" path="/security/resources" -->
```go
package main
@@ -128,6 +130,7 @@ Get the User data from the provided X-Plex-Token
### Example Usage
<!-- UsageSnippet language="go" operationID="getTokenDetails" method="get" path="/user" -->
```go
package main
@@ -179,6 +182,7 @@ Sign in user with username and password and return user data with Plex authentic
### Example Usage
<!-- UsageSnippet language="go" operationID="post-users-sign-in-data" method="post" path="/users/signin" -->
```go
package main

View File

@@ -20,6 +20,7 @@ Returns a list of butler tasks
### Example Usage
<!-- UsageSnippet language="go" operationID="getButlerTasks" method="get" path="/butler" -->
```go
package main
@@ -76,6 +77,7 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set
### Example Usage
<!-- UsageSnippet language="go" operationID="startAllTasks" method="post" path="/butler" -->
```go
package main
@@ -128,6 +130,7 @@ This endpoint will stop all currently running tasks and remove any scheduled tas
### Example Usage
<!-- UsageSnippet language="go" operationID="stopAllTasks" method="delete" path="/butler" -->
```go
package main
@@ -184,6 +187,7 @@ This endpoint will attempt to start a single Butler task that is enabled in the
### Example Usage
<!-- UsageSnippet language="go" operationID="startTask" method="post" path="/butler/{taskName}" -->
```go
package main
@@ -238,6 +242,7 @@ This endpoint will stop a currently running task by name, or remove it from the
### Example Usage
<!-- UsageSnippet language="go" operationID="stopTask" method="delete" path="/butler/{taskName}" -->
```go
package main

View File

@@ -18,6 +18,7 @@ Get Global Hubs filtered by the parameters provided.
### Example Usage
<!-- UsageSnippet language="go" operationID="getGlobalHubs" method="get" path="/hubs" -->
```go
package main
@@ -72,6 +73,7 @@ This endpoint will return the recently added content.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-recently-added" method="get" path="/hubs/home/recentlyAdded" -->
```go
package main
@@ -129,6 +131,7 @@ This endpoint will return a list of library specific hubs
### Example Usage
<!-- UsageSnippet language="go" operationID="getLibraryHubs" method="get" path="/hubs/sections/{sectionId}" -->
```go
package main

View File

@@ -35,6 +35,7 @@ This resource returns hash values for local files
### Example Usage
<!-- UsageSnippet language="go" operationID="getFileHash" method="get" path="/library/hashes" -->
```go
package main
@@ -51,7 +52,7 @@ func main() {
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetFileHash(ctx, "file://C:\Image.png&type=13", nil)
res, err := s.Library.GetFileHash(ctx, "file://C:\\Image.png&type=13", nil)
if err != nil {
log.Fatal(err)
}
@@ -89,6 +90,7 @@ This endpoint will return the recently added content.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-recently-added-library" method="get" path="/library/recentlyAdded" -->
```go
package main
@@ -167,6 +169,7 @@ This allows a client to provide a rich interface around the media (e.g. allow so
### Example Usage
<!-- UsageSnippet language="go" operationID="get-all-libraries" method="get" path="/library/sections" -->
```go
package main
@@ -257,6 +260,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
### Example Usage
<!-- UsageSnippet language="go" operationID="get-library-details" method="get" path="/library/sections/{sectionKey}" -->
```go
package main
@@ -311,6 +315,7 @@ Delete a library using a specific section id
### Example Usage
<!-- UsageSnippet language="go" operationID="deleteLibrary" method="delete" path="/library/sections/{sectionKey}" -->
```go
package main
@@ -384,6 +389,7 @@ Fetches details from a specific section of the library identified by a section k
### Example Usage
<!-- UsageSnippet language="go" operationID="get-library-items" method="get" path="/library/sections/{sectionKey}/{tag}" -->
```go
package main
@@ -444,6 +450,7 @@ Retrieves a list of all general media data for this library.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-library-sections-all" method="get" path="/library/sections/{sectionKey}/all" -->
```go
package main
@@ -506,6 +513,7 @@ This endpoint Refreshes all the Metadata of the library.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-refresh-library-metadata" method="get" path="/library/sections/{sectionKey}/refresh" -->
```go
package main
@@ -578,6 +586,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
### Example Usage
<!-- UsageSnippet language="go" operationID="get-search-library" method="get" path="/library/sections/{sectionKey}/search" -->
```go
package main
@@ -633,6 +642,7 @@ Retrieves a list of all the genres that are found for the media in this library.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-genres-library" method="get" path="/library/sections/{sectionKey}/genre" -->
```go
package main
@@ -688,6 +698,7 @@ Retrieves a list of all the countries that are found for the media in this libra
### Example Usage
<!-- UsageSnippet language="go" operationID="get-countries-library" method="get" path="/library/sections/{sectionKey}/country" -->
```go
package main
@@ -743,6 +754,7 @@ Retrieves a list of all the actors that are found for the media in this library.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-actors-library" method="get" path="/library/sections/{sectionKey}/actor" -->
```go
package main
@@ -798,6 +810,7 @@ Search the provided query across all library sections, or a single section, and
### Example Usage
<!-- UsageSnippet language="go" operationID="get-search-all-libraries" method="get" path="/library/search" -->
```go
package main
@@ -861,6 +874,7 @@ Multiple rating keys can be provided as a comma-separated list (e.g., "21119,216
### Example Usage
<!-- UsageSnippet language="go" operationID="get-media-meta-data" method="get" path="/library/metadata/{ratingKey}" -->
```go
package main
@@ -929,6 +943,7 @@ Returns the background artwork for a library item.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-media-arts" method="get" path="/library/metadata/{ratingKey}/arts" -->
```go
package main
@@ -979,6 +994,7 @@ Uploads an image to use as the background artwork for a library item, either fro
### Example Usage
<!-- UsageSnippet language="go" operationID="post-media-arts" method="post" path="/library/metadata/{ratingKey}/arts" -->
```go
package main
@@ -1031,6 +1047,7 @@ Returns the available posters for a library item.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-media-posters" method="get" path="/library/metadata/{ratingKey}/posters" -->
```go
package main
@@ -1081,6 +1098,7 @@ Uploads a poster to a library item, either from a local file or a remote URL
### Example Usage
<!-- UsageSnippet language="go" operationID="post-media-poster" method="post" path="/library/metadata/{ratingKey}/posters" -->
```go
package main
@@ -1134,6 +1152,7 @@ This endpoint will return the children of of a library item specified with the r
### Example Usage
<!-- UsageSnippet language="go" operationID="getMetadataChildren" method="get" path="/library/metadata/{ratingKey}/children" -->
```go
package main
@@ -1188,6 +1207,7 @@ This endpoint will return the top watched content from libraries of a certain ty
### Example Usage
<!-- UsageSnippet language="go" operationID="getTopWatchedContent" method="get" path="/library/all/top" -->
```go
package main

View File

@@ -19,6 +19,7 @@ This endpoint will write a single-line log message, including a level and source
### Example Usage
<!-- UsageSnippet language="go" operationID="logLine" method="get" path="/log" -->
```go
package main
@@ -95,6 +96,7 @@ Ensure each parameter is properly URL-encoded to avoid interpretation issues.
### Example Usage
<!-- UsageSnippet language="go" operationID="logMultiLine" method="post" path="/log" -->
```go
package main
@@ -150,6 +152,7 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail
### Example Usage
<!-- UsageSnippet language="go" operationID="enablePaperTrail" method="get" path="/log/networked" -->
```go
package main

View File

@@ -20,6 +20,7 @@ This will mark the provided media key as Played.
### Example Usage
<!-- UsageSnippet language="go" operationID="markPlayed" method="get" path="/:/scrobble" -->
```go
package main
@@ -72,6 +73,7 @@ This will mark the provided media key as Unplayed.
### Example Usage
<!-- UsageSnippet language="go" operationID="markUnplayed" method="get" path="/:/unscrobble" -->
```go
package main
@@ -125,6 +127,7 @@ This API command can be used to update the play progress of a media item.
### Example Usage
<!-- UsageSnippet language="go" operationID="updatePlayProgress" method="post" path="/:/progress" -->
```go
package main
@@ -179,6 +182,7 @@ Gets the banner image of the media item
### Example Usage
<!-- UsageSnippet language="go" operationID="get-banner-image" method="get" path="/library/metadata/{ratingKey}/banner" -->
```go
package main
@@ -239,6 +243,7 @@ Gets the thumbnail image of the media item
### Example Usage
<!-- UsageSnippet language="go" operationID="get-thumb-image" method="get" path="/library/metadata/{ratingKey}/thumb" -->
```go
package main

View File

@@ -30,6 +30,7 @@ Create a new playlist. By default the playlist is blank. To create a playlist al
### Example Usage
<!-- UsageSnippet language="go" operationID="createPlaylist" method="post" path="/playlists" -->
```go
package main
@@ -88,6 +89,7 @@ Get All Playlists given the specified filters.
### Example Usage
<!-- UsageSnippet language="go" operationID="getPlaylists" method="get" path="/playlists" -->
```go
package main
@@ -143,6 +145,7 @@ Smart playlist details contain the `content` attribute. This is the content URI
### Example Usage
<!-- UsageSnippet language="go" operationID="getPlaylist" method="get" path="/playlists/{playlistID}" -->
```go
package main
@@ -196,6 +199,7 @@ This endpoint will delete a playlist
### Example Usage
<!-- UsageSnippet language="go" operationID="deletePlaylist" method="delete" path="/playlists/{playlistID}" -->
```go
package main
@@ -249,6 +253,7 @@ From PMS version 1.9.1 clients can also edit playlist metadata using this endpoi
### Example Usage
<!-- UsageSnippet language="go" operationID="updatePlaylist" method="put" path="/playlists/{playlistID}" -->
```go
package main
@@ -307,6 +312,7 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u
### Example Usage
<!-- UsageSnippet language="go" operationID="getPlaylistContents" method="get" path="/playlists/{playlistID}/items" -->
```go
package main
@@ -362,6 +368,7 @@ Clears a playlist, only works with dumb playlists. Returns the playlist.
### Example Usage
<!-- UsageSnippet language="go" operationID="clearPlaylistContents" method="delete" path="/playlists/{playlistID}/items" -->
```go
package main
@@ -416,6 +423,7 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the
### Example Usage
<!-- UsageSnippet language="go" operationID="addPlaylistContents" method="put" path="/playlists/{playlistID}/items" -->
```go
package main
@@ -471,6 +479,7 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted
### Example Usage
<!-- UsageSnippet language="go" operationID="uploadPlaylist" method="post" path="/playlists/upload" -->
```go
package main

View File

@@ -22,6 +22,7 @@ Get Companions Data
### Example Usage
<!-- UsageSnippet language="go" operationID="getCompanionsData" method="get" path="/companions" -->
```go
package main
@@ -73,6 +74,7 @@ Get friends of provided auth token.
### Example Usage
<!-- UsageSnippet language="go" operationID="getUserFriends" method="get" path="/friends" -->
```go
package main
@@ -124,6 +126,7 @@ Returns the geolocation and locale data of the caller
### Example Usage
<!-- UsageSnippet language="go" operationID="getGeoData" method="get" path="/geoip" -->
```go
package main
@@ -173,6 +176,7 @@ Retrieves the home data for the authenticated user, including details like home
### Example Usage
<!-- UsageSnippet language="go" operationID="getHomeData" method="get" path="/home" -->
```go
package main
@@ -224,6 +228,7 @@ Get Plex server access tokens and server connections
### Example Usage
<!-- UsageSnippet language="go" operationID="get-server-resources" method="get" path="/resources" -->
```go
package main
@@ -280,6 +285,7 @@ Retrieve a Pin ID from Plex.tv to use for authentication flows
### Example Usage
<!-- UsageSnippet language="go" operationID="getPin" method="post" path="/pins" -->
```go
package main
@@ -336,6 +342,7 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated
### Example Usage
<!-- UsageSnippet language="go" operationID="getTokenByPinId" method="get" path="/pins/{pinID}" -->
```go
package main

View File

@@ -30,6 +30,7 @@ This request is intended to be very fast, and called as the user types.
### Example Usage
<!-- UsageSnippet language="go" operationID="performSearch" method="get" path="/hubs/search" -->
```go
package main
@@ -88,6 +89,7 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu
### Example Usage
<!-- UsageSnippet language="go" operationID="performVoiceSearch" method="get" path="/hubs/search/voice" -->
```go
package main
@@ -142,6 +144,7 @@ This will search the database for the string provided.
### Example Usage
<!-- UsageSnippet language="go" operationID="getSearchResults" method="get" path="/search" -->
```go
package main

View File

@@ -24,6 +24,7 @@ Get Server Capabilities
### Example Usage
<!-- UsageSnippet language="go" operationID="getServerCapabilities" method="get" path="/" -->
```go
package main
@@ -75,6 +76,7 @@ Get Server Preferences
### Example Usage
<!-- UsageSnippet language="go" operationID="getServerPreferences" method="get" path="/:/prefs" -->
```go
package main
@@ -126,6 +128,7 @@ Get Available Clients
### Example Usage
<!-- UsageSnippet language="go" operationID="getAvailableClients" method="get" path="/clients" -->
```go
package main
@@ -177,6 +180,7 @@ Get Devices
### Example Usage
<!-- UsageSnippet language="go" operationID="getDevices" method="get" path="/devices" -->
```go
package main
@@ -228,6 +232,7 @@ This request is useful to determine if the server is online or offline
### Example Usage
<!-- UsageSnippet language="go" operationID="get-server-identity" method="get" path="/identity" -->
```go
package main
@@ -276,6 +281,7 @@ Returns MyPlex Account Information
### Example Usage
<!-- UsageSnippet language="go" operationID="getMyPlexAccount" method="get" path="/myplex/account" -->
```go
package main
@@ -328,6 +334,7 @@ Plex's Photo transcoder is used throughout the service to serve images at specif
### Example Usage
<!-- UsageSnippet language="go" operationID="getResizedPhoto" method="get" path="/photo/:/transcode" -->
```go
package main
@@ -388,6 +395,7 @@ Retrieves media providers and their features from the Plex server.
### Example Usage
<!-- UsageSnippet language="go" operationID="get-media-providers" method="get" path="/media/providers" -->
```go
package main
@@ -440,6 +448,7 @@ Get Server List
### Example Usage
<!-- UsageSnippet language="go" operationID="getServerList" method="get" path="/servers" -->
```go
package main

View File

@@ -19,6 +19,7 @@ This will retrieve the "Now Playing" Information of the PMS.
### Example Usage
<!-- UsageSnippet language="go" operationID="getSessions" method="get" path="/status/sessions" -->
```go
package main
@@ -70,6 +71,7 @@ This will Retrieve a listing of all history views.
### Example Usage
<!-- UsageSnippet language="go" operationID="getSessionHistory" method="get" path="/status/sessions/history/all" -->
```go
package main
@@ -126,6 +128,7 @@ Get Transcode Sessions
### Example Usage
<!-- UsageSnippet language="go" operationID="getTranscodeSessions" method="get" path="/transcode/sessions" -->
```go
package main
@@ -177,6 +180,7 @@ Stop a Transcode Session
### Example Usage
<!-- UsageSnippet language="go" operationID="stopTranscodeSession" method="delete" path="/transcode/sessions/{sessionKey}" -->
```go
package main

View File

@@ -18,6 +18,7 @@ This will return the media statistics for the server
### Example Usage
<!-- UsageSnippet language="go" operationID="getStatistics" method="get" path="/statistics/media" -->
```go
package main
@@ -70,6 +71,7 @@ This will return the resources for the server
### Example Usage
<!-- UsageSnippet language="go" operationID="getResourcesStatistics" method="get" path="/statistics/resources" -->
```go
package main
@@ -122,6 +124,7 @@ This will return the bandwidth statistics for the server
### Example Usage
<!-- UsageSnippet language="go" operationID="getBandwidthStatistics" method="get" path="/statistics/bandwidth" -->
```go
package main

View File

@@ -19,6 +19,7 @@ Querying status of updates
### Example Usage
<!-- UsageSnippet language="go" operationID="getUpdateStatus" method="get" path="/updater/status" -->
```go
package main
@@ -70,6 +71,7 @@ Checking for updates
### Example Usage
<!-- UsageSnippet language="go" operationID="checkForUpdates" method="put" path="/updater/check" -->
```go
package main
@@ -124,6 +126,7 @@ Note that these two parameters are effectively mutually exclusive. The `tonight`
### Example Usage
<!-- UsageSnippet language="go" operationID="applyUpdates" method="put" path="/updater/apply" -->
```go
package main

View File

@@ -13,6 +13,7 @@ Get list of all users that are friends and have library access with the provided
### Example Usage
<!-- UsageSnippet language="go" operationID="get-users" method="get" path="/users" -->
```go
package main

View File

@@ -17,6 +17,7 @@ Get the timeline for a media item
### Example Usage
<!-- UsageSnippet language="go" operationID="getTimeline" method="get" path="/:/timeline" -->
```go
package main
@@ -81,6 +82,7 @@ Begin a Universal Transcode Session
### Example Usage
<!-- UsageSnippet language="go" operationID="startUniversalTranscode" method="get" path="/video/:/transcode/universal/start.mpd" -->
```go
package main

View File

@@ -16,6 +16,7 @@ Get User Watchlist
### Example Usage
<!-- UsageSnippet language="go" operationID="get-watch-list" method="get" path="/library/sections/watchlist/{filter}" -->
```go
package main

View File

@@ -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) {

View File

@@ -7,8 +7,11 @@ import (
"context"
"fmt"
"io"
"mime"
"mime/multipart"
"net/textproto"
"net/url"
"path/filepath"
"reflect"
"regexp"
)
@@ -166,9 +169,21 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) {
tag := parseMultipartFormTag(field)
if tag.File {
if err := encodeMultipartFormDataFile(writer, tag.Name, fieldType, valType); err != nil {
writer.Close()
return "", err
switch fieldType.Kind() {
case reflect.Slice, reflect.Array:
for i := 0; i < valType.Len(); i++ {
arrayVal := valType.Index(i)
if err := encodeMultipartFormDataFile(writer, tag.Name+"[]", arrayVal.Type(), arrayVal); err != nil {
writer.Close()
return "", err
}
}
default:
if err := encodeMultipartFormDataFile(writer, tag.Name, fieldType, valType); err != nil {
writer.Close()
return "", err
}
}
} else if tag.JSON {
jw, err := writer.CreateFormField(tag.Name)
@@ -243,7 +258,18 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldName string, fieldTyp
return fmt.Errorf("invalid multipart/form-data file")
}
fw, err := w.CreateFormFile(fieldName, fileName)
// Detect content type based on file extension
contentType := mime.TypeByExtension(filepath.Ext(fileName))
if contentType == "" {
contentType = "application/octet-stream"
}
// Create multipart header with proper content type
h := make(textproto.MIMEHeader)
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="%s"; filename="%s"`, fieldName, fileName))
h.Set("Content-Type", contentType)
fw, err := w.CreatePart(h)
if err != nil {
return err
}
@@ -251,6 +277,11 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldName string, fieldTyp
return err
}
// Reset seek position to 0 if the reader supports seeking
if seeker, ok := reader.(io.Seeker); ok {
_, _ = seeker.Seek(0, io.SeekStart)
}
return nil
}

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -2,7 +2,7 @@
package plexgo
// Generated from OpenAPI doc version 0.0.3 and generator version 2.623.4
// 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.23.0",
SDKVersion: "0.24.2",
sdkConfiguration: config.SDKConfiguration{
UserAgent: "speakeasy-sdk/go 0.23.0 2.623.4 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{
{