Compare commits

..

2 Commits

Author SHA1 Message Date
speakeasybot
1f5d4ff03a ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.3 2025-08-07 00:28:41 +00:00
speakeasybot
d970db3b6f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.0 2025-08-06 00:28:40 +00:00
128 changed files with 3508 additions and 1576 deletions

View File

@@ -3,10 +3,10 @@ id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
management:
docChecksum: 77bdddd188d0778dc73b7f7906e1677c
docVersion: 0.0.3
speakeasyVersion: 1.557.0
generationVersion: 2.623.0
releaseVersion: 0.15.1
configChecksum: 0d77f3a7a510b4818fc2819df5d3ceae
speakeasyVersion: 1.598.3
generationVersion: 2.674.3
releaseVersion: 0.16.1
configChecksum: 641f6f04797332d3e0349120f669df14
repoURL: https://github.com/LukeHagar/plexcsharp.git
repoSubDirectory: .
published: true
@@ -14,7 +14,7 @@ features:
csharp:
additionalDependencies: 0.1.0
constsAndDefaults: 0.0.1
core: 3.11.0
core: 3.11.2
deprecations: 2.81.2
enums: 2.82.0
errors: 0.2.1
@@ -28,6 +28,7 @@ features:
methodServerURLs: 2.82.1
nameOverrides: 2.81.2
nullables: 0.1.1
openEnums: 0.1.0
responseFormat: 0.0.4
sdkHooks: 0.2.0
unions: 0.2.2
@@ -973,6 +974,7 @@ generatedFiles:
- LukeHagar/PlexAPI/SDK/Utils/FlexibleObjectDeserializer.cs
- LukeHagar/PlexAPI/SDK/Utils/HeaderSerializer.cs
- LukeHagar/PlexAPI/SDK/Utils/IsoDateTimeSerializer.cs
- LukeHagar/PlexAPI/SDK/Utils/OpenEnumConverter.cs
- LukeHagar/PlexAPI/SDK/Utils/RequestBodySerializer.cs
- LukeHagar/PlexAPI/SDK/Utils/ResponseBodyDeserializer.cs
- LukeHagar/PlexAPI/SDK/Utils/Retries/BackoffStrategy.cs
@@ -2039,6 +2041,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:
@@ -2096,6 +2109,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:
@@ -2121,6 +2152,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:
@@ -2140,6 +2195,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:
@@ -2235,6 +2299,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:
@@ -2251,6 +2330,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:
@@ -2265,6 +2359,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:
@@ -2519,6 +2630,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:
@@ -2828,6 +2955,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:
@@ -2840,6 +2984,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:
@@ -2852,6 +3007,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:
@@ -2864,6 +3030,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:
@@ -2956,6 +3133,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:
@@ -2994,6 +3184,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:
@@ -3005,6 +3204,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:
@@ -3029,5 +3238,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,12 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
csharp:
version: 0.15.1
version: 0.16.1
additionalDependencies: []
author: LukeHagar
baseErrorName: PlexAPIError

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.557.0
speakeasyVersion: 1.598.3
sources:
my-source:
sourceNamespace: my-source
@@ -16,19 +16,19 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
tags:
- latest
- speakeasy-sdk-regen-1749428820
- speakeasy-sdk-regen-1754526448
targets:
plexcsharp:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:3e40165c9db5020b3885878073275cf7a8e9cfc5dc3f4a81b48c209581c6a041
codeSamplesRevisionDigest: sha256:8985bab43884b8a617bc2cf572f4eec3606eb77113fc8be80465ef446d95a656
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -74,8 +74,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Activities(SDKConfig config)

View File

@@ -95,8 +95,8 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Authentication(SDKConfig config)

View File

@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@@ -101,8 +103,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Butler(SDKConfig config)

View File

@@ -73,8 +73,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Hubs(SDKConfig config)

View File

@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@@ -319,8 +321,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Library(SDKConfig config)

View File

@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@@ -94,8 +96,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Log(SDKConfig config)

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.15.1</Version>
<Version>0.16.1</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2025</Copyright>

View File

@@ -90,8 +90,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Media(SDKConfig config)

View File

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// type of playlist to create
/// </summary>
public enum CreatePlaylistQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class CreatePlaylistQueryParamType : IEquatable<CreatePlaylistQueryParamType>
{
[JsonProperty("audio")]
Audio,
[JsonProperty("video")]
Video,
[JsonProperty("photo")]
Photo,
}
public static readonly CreatePlaylistQueryParamType Audio = new CreatePlaylistQueryParamType("audio");
public static readonly CreatePlaylistQueryParamType Video = new CreatePlaylistQueryParamType("video");
public static readonly CreatePlaylistQueryParamType Photo = new CreatePlaylistQueryParamType("photo");
public static class CreatePlaylistQueryParamTypeExtension
{
public static string Value(this CreatePlaylistQueryParamType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static CreatePlaylistQueryParamType ToEnum(this string value)
{
foreach(var field in typeof(CreatePlaylistQueryParamType).GetFields())
private static readonly Dictionary <string, CreatePlaylistQueryParamType> _knownValues =
new Dictionary <string, CreatePlaylistQueryParamType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["audio"] = Audio,
["video"] = Video,
["photo"] = Photo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, CreatePlaylistQueryParamType> _values =
new ConcurrentDictionary<string, CreatePlaylistQueryParamType>(_knownValues);
if (enumVal is CreatePlaylistQueryParamType)
{
return (CreatePlaylistQueryParamType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum CreatePlaylistQueryParamType");
private CreatePlaylistQueryParamType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static CreatePlaylistQueryParamType Of(string value)
{
return _values.GetOrAdd(value, _ => new CreatePlaylistQueryParamType(value));
}
public static implicit operator CreatePlaylistQueryParamType(string value) => Of(value);
public static implicit operator string(CreatePlaylistQueryParamType createplaylistqueryparamtype) => createplaylistqueryparamtype.Value;
public static CreatePlaylistQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as CreatePlaylistQueryParamType);
public bool Equals(CreatePlaylistQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class CreatePlaylistRequest
{

View File

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Filter
/// </summary>
public enum Filter
[JsonConverter(typeof(OpenEnumConverter))]
public class Filter : IEquatable<Filter>
{
[JsonProperty("all")]
All,
[JsonProperty("available")]
Available,
[JsonProperty("released")]
Released,
}
public static readonly Filter All = new Filter("all");
public static readonly Filter Available = new Filter("available");
public static readonly Filter Released = new Filter("released");
public static class FilterExtension
{
public static string Value(this Filter value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Filter ToEnum(this string value)
{
foreach(var field in typeof(Filter).GetFields())
private static readonly Dictionary <string, Filter> _knownValues =
new Dictionary <string, Filter> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["all"] = All,
["available"] = Available,
["released"] = Released
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, Filter> _values =
new ConcurrentDictionary<string, Filter>(_knownValues);
if (enumVal is Filter)
{
return (Filter)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Filter");
private Filter(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static Filter Of(string value)
{
return _values.GetOrAdd(value, _ => new Filter(value));
}
public static implicit operator Filter(string value) => Of(value);
public static implicit operator string(Filter filter) => filter.Value;
public static Filter[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Filter);
public bool Equals(Filter? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
///
@@ -20,47 +23,62 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum FlattenSeasons
[JsonConverter(typeof(OpenEnumConverter))]
public class FlattenSeasons : IEquatable<FlattenSeasons>
{
[JsonProperty("-1")]
LibraryDefault,
[JsonProperty("0")]
Hide,
[JsonProperty("1")]
Show,
}
public static readonly FlattenSeasons LibraryDefault = new FlattenSeasons("-1");
public static readonly FlattenSeasons Hide = new FlattenSeasons("0");
public static readonly FlattenSeasons Show = new FlattenSeasons("1");
public static class FlattenSeasonsExtension
{
public static string Value(this FlattenSeasons value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static FlattenSeasons ToEnum(this string value)
{
foreach(var field in typeof(FlattenSeasons).GetFields())
private static readonly Dictionary <string, FlattenSeasons> _knownValues =
new Dictionary <string, FlattenSeasons> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["-1"] = LibraryDefault,
["0"] = Hide,
["1"] = Show
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, FlattenSeasons> _values =
new ConcurrentDictionary<string, FlattenSeasons>(_knownValues);
if (enumVal is FlattenSeasons)
{
return (FlattenSeasons)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum FlattenSeasons");
private FlattenSeasons(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static FlattenSeasons Of(string value)
{
return _values.GetOrAdd(value, _ => new FlattenSeasons(value));
}
public static implicit operator FlattenSeasons(string value) => Of(value);
public static implicit operator string(FlattenSeasons flattenseasons) => flattenseasons.Value;
public static FlattenSeasons[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as FlattenSeasons);
public bool Equals(FlattenSeasons? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class Friend
{

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetActorsLibraryQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetActorsLibraryQueryParamType : IEquatable<GetActorsLibraryQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1);
public static readonly GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2);
public static readonly GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3);
public static readonly GetActorsLibraryQueryParamType Episode = new GetActorsLibraryQueryParamType(4);
public static readonly GetActorsLibraryQueryParamType Artist = new GetActorsLibraryQueryParamType(5);
public static readonly GetActorsLibraryQueryParamType Album = new GetActorsLibraryQueryParamType(6);
public static readonly GetActorsLibraryQueryParamType Track = new GetActorsLibraryQueryParamType(7);
public static readonly GetActorsLibraryQueryParamType PhotoAlbum = new GetActorsLibraryQueryParamType(8);
public static readonly GetActorsLibraryQueryParamType Photo = new GetActorsLibraryQueryParamType(9);
private static readonly Dictionary <long, GetActorsLibraryQueryParamType> _knownValues =
new Dictionary <long, GetActorsLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetActorsLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetActorsLibraryQueryParamType>(_knownValues);
private GetActorsLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetActorsLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetActorsLibraryQueryParamType(value));
}
public static implicit operator GetActorsLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetActorsLibraryQueryParamType getactorslibraryqueryparamtype) => getactorslibraryqueryparamtype.Value;
public static GetActorsLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetActorsLibraryQueryParamType);
public bool Equals(GetActorsLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetActorsLibraryRequest
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetAllLibrariesDirectory
{

View File

@@ -12,65 +12,83 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The library type
/// </summary>
public enum GetAllLibrariesType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetAllLibrariesType : IEquatable<GetAllLibrariesType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
public static readonly GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
public static readonly GetAllLibrariesType Season = new GetAllLibrariesType("season");
public static readonly GetAllLibrariesType Episode = new GetAllLibrariesType("episode");
public static readonly GetAllLibrariesType Artist = new GetAllLibrariesType("artist");
public static readonly GetAllLibrariesType Album = new GetAllLibrariesType("album");
public static readonly GetAllLibrariesType Track = new GetAllLibrariesType("track");
public static readonly GetAllLibrariesType PhotoAlbum = new GetAllLibrariesType("photoalbum");
public static readonly GetAllLibrariesType Photo = new GetAllLibrariesType("photo");
public static readonly GetAllLibrariesType Collection = new GetAllLibrariesType("collection");
public static class GetAllLibrariesTypeExtension
{
public static string Value(this GetAllLibrariesType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetAllLibrariesType ToEnum(this string value)
{
foreach(var field in typeof(GetAllLibrariesType).GetFields())
private static readonly Dictionary <string, GetAllLibrariesType> _knownValues =
new Dictionary <string, GetAllLibrariesType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetAllLibrariesType> _values =
new ConcurrentDictionary<string, GetAllLibrariesType>(_knownValues);
if (enumVal is GetAllLibrariesType)
{
return (GetAllLibrariesType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetAllLibrariesType");
private GetAllLibrariesType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetAllLibrariesType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetAllLibrariesType(value));
}
public static implicit operator GetAllLibrariesType(string value) => Of(value);
public static implicit operator string(GetAllLibrariesType getalllibrariestype) => getalllibrariestype.Value;
public static GetAllLibrariesType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetAllLibrariesType);
public bool Equals(GetAllLibrariesType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetCountriesLibraryQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetCountriesLibraryQueryParamType : IEquatable<GetCountriesLibraryQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1);
public static readonly GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2);
public static readonly GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3);
public static readonly GetCountriesLibraryQueryParamType Episode = new GetCountriesLibraryQueryParamType(4);
public static readonly GetCountriesLibraryQueryParamType Artist = new GetCountriesLibraryQueryParamType(5);
public static readonly GetCountriesLibraryQueryParamType Album = new GetCountriesLibraryQueryParamType(6);
public static readonly GetCountriesLibraryQueryParamType Track = new GetCountriesLibraryQueryParamType(7);
public static readonly GetCountriesLibraryQueryParamType PhotoAlbum = new GetCountriesLibraryQueryParamType(8);
public static readonly GetCountriesLibraryQueryParamType Photo = new GetCountriesLibraryQueryParamType(9);
private static readonly Dictionary <long, GetCountriesLibraryQueryParamType> _knownValues =
new Dictionary <long, GetCountriesLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetCountriesLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetCountriesLibraryQueryParamType>(_knownValues);
private GetCountriesLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetCountriesLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetCountriesLibraryQueryParamType(value));
}
public static implicit operator GetCountriesLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetCountriesLibraryQueryParamType getcountrieslibraryqueryparamtype) => getcountrieslibraryqueryparamtype.Value;
public static GetCountriesLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetCountriesLibraryQueryParamType);
public bool Equals(GetCountriesLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetCountriesLibraryRequest
{

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetGenresLibraryQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetGenresLibraryQueryParamType : IEquatable<GetGenresLibraryQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1);
public static readonly GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2);
public static readonly GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3);
public static readonly GetGenresLibraryQueryParamType Episode = new GetGenresLibraryQueryParamType(4);
public static readonly GetGenresLibraryQueryParamType Artist = new GetGenresLibraryQueryParamType(5);
public static readonly GetGenresLibraryQueryParamType Album = new GetGenresLibraryQueryParamType(6);
public static readonly GetGenresLibraryQueryParamType Track = new GetGenresLibraryQueryParamType(7);
public static readonly GetGenresLibraryQueryParamType PhotoAlbum = new GetGenresLibraryQueryParamType(8);
public static readonly GetGenresLibraryQueryParamType Photo = new GetGenresLibraryQueryParamType(9);
private static readonly Dictionary <long, GetGenresLibraryQueryParamType> _knownValues =
new Dictionary <long, GetGenresLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetGenresLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetGenresLibraryQueryParamType>(_knownValues);
private GetGenresLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetGenresLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetGenresLibraryQueryParamType(value));
}
public static implicit operator GetGenresLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetGenresLibraryQueryParamType getgenreslibraryqueryparamtype) => getgenreslibraryqueryparamtype.Value;
public static GetGenresLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetGenresLibraryQueryParamType);
public bool Equals(GetGenresLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetGenresLibraryRequest
{

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetLibraryItemsImage
{

View File

@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetLibraryItemsLibraryResponseType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetLibraryItemsLibraryResponseTypeExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibraryItemsLibraryResponseType : IEquatable<GetLibraryItemsLibraryResponseType>
{
public static string Value(this GetLibraryItemsLibraryResponseType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetLibraryItemsLibraryResponseType CoverPoster = new GetLibraryItemsLibraryResponseType("coverPoster");
public static readonly GetLibraryItemsLibraryResponseType Background = new GetLibraryItemsLibraryResponseType("background");
public static readonly GetLibraryItemsLibraryResponseType Snapshot = new GetLibraryItemsLibraryResponseType("snapshot");
public static readonly GetLibraryItemsLibraryResponseType ClearLogo = new GetLibraryItemsLibraryResponseType("clearLogo");
public static GetLibraryItemsLibraryResponseType ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsLibraryResponseType).GetFields())
private static readonly Dictionary <string, GetLibraryItemsLibraryResponseType> _knownValues =
new Dictionary <string, GetLibraryItemsLibraryResponseType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType> _values =
new ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType>(_knownValues);
if (enumVal is GetLibraryItemsLibraryResponseType)
{
return (GetLibraryItemsLibraryResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryResponseType");
private GetLibraryItemsLibraryResponseType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetLibraryItemsLibraryResponseType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetLibraryItemsLibraryResponseType(value));
}
public static implicit operator GetLibraryItemsLibraryResponseType(string value) => Of(value);
public static implicit operator string(GetLibraryItemsLibraryResponseType getlibraryitemslibraryresponsetype) => getlibraryitemslibraryresponsetype.Value;
public static GetLibraryItemsLibraryResponseType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibraryItemsLibraryResponseType);
public bool Equals(GetLibraryItemsLibraryResponseType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibraryItemsQueryParamType : IEquatable<GetLibraryItemsQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetLibraryItemsQueryParamType Movie = new GetLibraryItemsQueryParamType(1);
public static readonly GetLibraryItemsQueryParamType TvShow = new GetLibraryItemsQueryParamType(2);
public static readonly GetLibraryItemsQueryParamType Season = new GetLibraryItemsQueryParamType(3);
public static readonly GetLibraryItemsQueryParamType Episode = new GetLibraryItemsQueryParamType(4);
public static readonly GetLibraryItemsQueryParamType Artist = new GetLibraryItemsQueryParamType(5);
public static readonly GetLibraryItemsQueryParamType Album = new GetLibraryItemsQueryParamType(6);
public static readonly GetLibraryItemsQueryParamType Track = new GetLibraryItemsQueryParamType(7);
public static readonly GetLibraryItemsQueryParamType PhotoAlbum = new GetLibraryItemsQueryParamType(8);
public static readonly GetLibraryItemsQueryParamType Photo = new GetLibraryItemsQueryParamType(9);
private static readonly Dictionary <long, GetLibraryItemsQueryParamType> _knownValues =
new Dictionary <long, GetLibraryItemsQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetLibraryItemsQueryParamType> _values =
new ConcurrentDictionary<long, GetLibraryItemsQueryParamType>(_knownValues);
private GetLibraryItemsQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetLibraryItemsQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetLibraryItemsQueryParamType(value));
}
public static implicit operator GetLibraryItemsQueryParamType(long value) => Of(value);
public static implicit operator long(GetLibraryItemsQueryParamType getlibraryitemsqueryparamtype) => getlibraryitemsqueryparamtype.Value;
public static GetLibraryItemsQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibraryItemsQueryParamType);
public bool Equals(GetLibraryItemsQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetLibraryItemsRequest
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
@@ -20,61 +23,76 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibraryItemsType : IEquatable<GetLibraryItemsType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetLibraryItemsType Movie = new GetLibraryItemsType("movie");
public static readonly GetLibraryItemsType TvShow = new GetLibraryItemsType("show");
public static readonly GetLibraryItemsType Season = new GetLibraryItemsType("season");
public static readonly GetLibraryItemsType Episode = new GetLibraryItemsType("episode");
public static readonly GetLibraryItemsType Artist = new GetLibraryItemsType("artist");
public static readonly GetLibraryItemsType Album = new GetLibraryItemsType("album");
public static readonly GetLibraryItemsType Track = new GetLibraryItemsType("track");
public static readonly GetLibraryItemsType PhotoAlbum = new GetLibraryItemsType("photoalbum");
public static readonly GetLibraryItemsType Photo = new GetLibraryItemsType("photo");
public static readonly GetLibraryItemsType Collection = new GetLibraryItemsType("collection");
public static class GetLibraryItemsTypeExtension
{
public static string Value(this GetLibraryItemsType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsType ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsType).GetFields())
private static readonly Dictionary <string, GetLibraryItemsType> _knownValues =
new Dictionary <string, GetLibraryItemsType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetLibraryItemsType> _values =
new ConcurrentDictionary<string, GetLibraryItemsType>(_knownValues);
if (enumVal is GetLibraryItemsType)
{
return (GetLibraryItemsType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsType");
private GetLibraryItemsType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetLibraryItemsType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetLibraryItemsType(value));
}
public static implicit operator GetLibraryItemsType(string value) => Of(value);
public static implicit operator string(GetLibraryItemsType getlibraryitemstype) => getlibraryitemstype.Value;
public static GetLibraryItemsType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibraryItemsType);
public bool Equals(GetLibraryItemsType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetLibrarySectionsAllImage
{

View File

@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetLibrarySectionsAllLibraryResponseType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetLibrarySectionsAllLibraryResponseTypeExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibrarySectionsAllLibraryResponseType : IEquatable<GetLibrarySectionsAllLibraryResponseType>
{
public static string Value(this GetLibrarySectionsAllLibraryResponseType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetLibrarySectionsAllLibraryResponseType CoverPoster = new GetLibrarySectionsAllLibraryResponseType("coverPoster");
public static readonly GetLibrarySectionsAllLibraryResponseType Background = new GetLibrarySectionsAllLibraryResponseType("background");
public static readonly GetLibrarySectionsAllLibraryResponseType Snapshot = new GetLibrarySectionsAllLibraryResponseType("snapshot");
public static readonly GetLibrarySectionsAllLibraryResponseType ClearLogo = new GetLibrarySectionsAllLibraryResponseType("clearLogo");
public static GetLibrarySectionsAllLibraryResponseType ToEnum(this string value)
{
foreach(var field in typeof(GetLibrarySectionsAllLibraryResponseType).GetFields())
private static readonly Dictionary <string, GetLibrarySectionsAllLibraryResponseType> _knownValues =
new Dictionary <string, GetLibrarySectionsAllLibraryResponseType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetLibrarySectionsAllLibraryResponseType> _values =
new ConcurrentDictionary<string, GetLibrarySectionsAllLibraryResponseType>(_knownValues);
if (enumVal is GetLibrarySectionsAllLibraryResponseType)
{
return (GetLibrarySectionsAllLibraryResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryResponseType");
private GetLibrarySectionsAllLibraryResponseType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetLibrarySectionsAllLibraryResponseType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetLibrarySectionsAllLibraryResponseType(value));
}
public static implicit operator GetLibrarySectionsAllLibraryResponseType(string value) => Of(value);
public static implicit operator string(GetLibrarySectionsAllLibraryResponseType getlibrarysectionsalllibraryresponsetype) => getlibrarysectionsalllibraryresponsetype.Value;
public static GetLibrarySectionsAllLibraryResponseType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibrarySectionsAllLibraryResponseType);
public bool Equals(GetLibrarySectionsAllLibraryResponseType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
@@ -20,61 +23,76 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetLibrarySectionsAllLibraryType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibrarySectionsAllLibraryType : IEquatable<GetLibrarySectionsAllLibraryType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetLibrarySectionsAllLibraryType Movie = new GetLibrarySectionsAllLibraryType("movie");
public static readonly GetLibrarySectionsAllLibraryType TvShow = new GetLibrarySectionsAllLibraryType("show");
public static readonly GetLibrarySectionsAllLibraryType Season = new GetLibrarySectionsAllLibraryType("season");
public static readonly GetLibrarySectionsAllLibraryType Episode = new GetLibrarySectionsAllLibraryType("episode");
public static readonly GetLibrarySectionsAllLibraryType Artist = new GetLibrarySectionsAllLibraryType("artist");
public static readonly GetLibrarySectionsAllLibraryType Album = new GetLibrarySectionsAllLibraryType("album");
public static readonly GetLibrarySectionsAllLibraryType Track = new GetLibrarySectionsAllLibraryType("track");
public static readonly GetLibrarySectionsAllLibraryType PhotoAlbum = new GetLibrarySectionsAllLibraryType("photoalbum");
public static readonly GetLibrarySectionsAllLibraryType Photo = new GetLibrarySectionsAllLibraryType("photo");
public static readonly GetLibrarySectionsAllLibraryType Collection = new GetLibrarySectionsAllLibraryType("collection");
public static class GetLibrarySectionsAllLibraryTypeExtension
{
public static string Value(this GetLibrarySectionsAllLibraryType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibrarySectionsAllLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetLibrarySectionsAllLibraryType).GetFields())
private static readonly Dictionary <string, GetLibrarySectionsAllLibraryType> _knownValues =
new Dictionary <string, GetLibrarySectionsAllLibraryType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetLibrarySectionsAllLibraryType> _values =
new ConcurrentDictionary<string, GetLibrarySectionsAllLibraryType>(_knownValues);
if (enumVal is GetLibrarySectionsAllLibraryType)
{
return (GetLibrarySectionsAllLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryType");
private GetLibrarySectionsAllLibraryType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetLibrarySectionsAllLibraryType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetLibrarySectionsAllLibraryType(value));
}
public static implicit operator GetLibrarySectionsAllLibraryType(string value) => Of(value);
public static implicit operator string(GetLibrarySectionsAllLibraryType getlibrarysectionsalllibrarytype) => getlibrarysectionsalllibrarytype.Value;
public static GetLibrarySectionsAllLibraryType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibrarySectionsAllLibraryType);
public bool Equals(GetLibrarySectionsAllLibraryType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetLibrarySectionsAllQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibrarySectionsAllQueryParamType : IEquatable<GetLibrarySectionsAllQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetLibrarySectionsAllQueryParamType Movie = new GetLibrarySectionsAllQueryParamType(1);
public static readonly GetLibrarySectionsAllQueryParamType TvShow = new GetLibrarySectionsAllQueryParamType(2);
public static readonly GetLibrarySectionsAllQueryParamType Season = new GetLibrarySectionsAllQueryParamType(3);
public static readonly GetLibrarySectionsAllQueryParamType Episode = new GetLibrarySectionsAllQueryParamType(4);
public static readonly GetLibrarySectionsAllQueryParamType Artist = new GetLibrarySectionsAllQueryParamType(5);
public static readonly GetLibrarySectionsAllQueryParamType Album = new GetLibrarySectionsAllQueryParamType(6);
public static readonly GetLibrarySectionsAllQueryParamType Track = new GetLibrarySectionsAllQueryParamType(7);
public static readonly GetLibrarySectionsAllQueryParamType PhotoAlbum = new GetLibrarySectionsAllQueryParamType(8);
public static readonly GetLibrarySectionsAllQueryParamType Photo = new GetLibrarySectionsAllQueryParamType(9);
private static readonly Dictionary <long, GetLibrarySectionsAllQueryParamType> _knownValues =
new Dictionary <long, GetLibrarySectionsAllQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetLibrarySectionsAllQueryParamType> _values =
new ConcurrentDictionary<long, GetLibrarySectionsAllQueryParamType>(_knownValues);
private GetLibrarySectionsAllQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetLibrarySectionsAllQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetLibrarySectionsAllQueryParamType(value));
}
public static implicit operator GetLibrarySectionsAllQueryParamType(long value) => Of(value);
public static implicit operator long(GetLibrarySectionsAllQueryParamType getlibrarysectionsallqueryparamtype) => getlibrarysectionsallqueryparamtype.Value;
public static GetLibrarySectionsAllQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibrarySectionsAllQueryParamType);
public bool Equals(GetLibrarySectionsAllQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetLibrarySectionsAllRequest
{

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetMediaMetaDataImage
{

View File

@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetMediaMetaDataLibraryType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetMediaMetaDataLibraryTypeExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetMediaMetaDataLibraryType : IEquatable<GetMediaMetaDataLibraryType>
{
public static string Value(this GetMediaMetaDataLibraryType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetMediaMetaDataLibraryType CoverPoster = new GetMediaMetaDataLibraryType("coverPoster");
public static readonly GetMediaMetaDataLibraryType Background = new GetMediaMetaDataLibraryType("background");
public static readonly GetMediaMetaDataLibraryType Snapshot = new GetMediaMetaDataLibraryType("snapshot");
public static readonly GetMediaMetaDataLibraryType ClearLogo = new GetMediaMetaDataLibraryType("clearLogo");
public static GetMediaMetaDataLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetMediaMetaDataLibraryType).GetFields())
private static readonly Dictionary <string, GetMediaMetaDataLibraryType> _knownValues =
new Dictionary <string, GetMediaMetaDataLibraryType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetMediaMetaDataLibraryType> _values =
new ConcurrentDictionary<string, GetMediaMetaDataLibraryType>(_knownValues);
if (enumVal is GetMediaMetaDataLibraryType)
{
return (GetMediaMetaDataLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataLibraryType");
private GetMediaMetaDataLibraryType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetMediaMetaDataLibraryType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetMediaMetaDataLibraryType(value));
}
public static implicit operator GetMediaMetaDataLibraryType(string value) => Of(value);
public static implicit operator string(GetMediaMetaDataLibraryType getmediametadatalibrarytype) => getmediametadatalibrarytype.Value;
public static GetMediaMetaDataLibraryType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetMediaMetaDataLibraryType);
public bool Equals(GetMediaMetaDataLibraryType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
@@ -20,61 +23,76 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetMediaMetaDataType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetMediaMetaDataType : IEquatable<GetMediaMetaDataType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetMediaMetaDataType Movie = new GetMediaMetaDataType("movie");
public static readonly GetMediaMetaDataType TvShow = new GetMediaMetaDataType("show");
public static readonly GetMediaMetaDataType Season = new GetMediaMetaDataType("season");
public static readonly GetMediaMetaDataType Episode = new GetMediaMetaDataType("episode");
public static readonly GetMediaMetaDataType Artist = new GetMediaMetaDataType("artist");
public static readonly GetMediaMetaDataType Album = new GetMediaMetaDataType("album");
public static readonly GetMediaMetaDataType Track = new GetMediaMetaDataType("track");
public static readonly GetMediaMetaDataType PhotoAlbum = new GetMediaMetaDataType("photoalbum");
public static readonly GetMediaMetaDataType Photo = new GetMediaMetaDataType("photo");
public static readonly GetMediaMetaDataType Collection = new GetMediaMetaDataType("collection");
public static class GetMediaMetaDataTypeExtension
{
public static string Value(this GetMediaMetaDataType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetMediaMetaDataType ToEnum(this string value)
{
foreach(var field in typeof(GetMediaMetaDataType).GetFields())
private static readonly Dictionary <string, GetMediaMetaDataType> _knownValues =
new Dictionary <string, GetMediaMetaDataType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetMediaMetaDataType> _values =
new ConcurrentDictionary<string, GetMediaMetaDataType>(_knownValues);
if (enumVal is GetMediaMetaDataType)
{
return (GetMediaMetaDataType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataType");
private GetMediaMetaDataType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetMediaMetaDataType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetMediaMetaDataType(value));
}
public static implicit operator GetMediaMetaDataType(string value) => Of(value);
public static implicit operator string(GetMediaMetaDataType getmediametadatatype) => getmediametadatatype.Value;
public static GetMediaMetaDataType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetMediaMetaDataType);
public bool Equals(GetMediaMetaDataType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetPlaylistContentsQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetPlaylistContentsQueryParamType : IEquatable<GetPlaylistContentsQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetPlaylistContentsQueryParamType Movie = new GetPlaylistContentsQueryParamType(1);
public static readonly GetPlaylistContentsQueryParamType TvShow = new GetPlaylistContentsQueryParamType(2);
public static readonly GetPlaylistContentsQueryParamType Season = new GetPlaylistContentsQueryParamType(3);
public static readonly GetPlaylistContentsQueryParamType Episode = new GetPlaylistContentsQueryParamType(4);
public static readonly GetPlaylistContentsQueryParamType Artist = new GetPlaylistContentsQueryParamType(5);
public static readonly GetPlaylistContentsQueryParamType Album = new GetPlaylistContentsQueryParamType(6);
public static readonly GetPlaylistContentsQueryParamType Track = new GetPlaylistContentsQueryParamType(7);
public static readonly GetPlaylistContentsQueryParamType PhotoAlbum = new GetPlaylistContentsQueryParamType(8);
public static readonly GetPlaylistContentsQueryParamType Photo = new GetPlaylistContentsQueryParamType(9);
private static readonly Dictionary <long, GetPlaylistContentsQueryParamType> _knownValues =
new Dictionary <long, GetPlaylistContentsQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetPlaylistContentsQueryParamType> _values =
new ConcurrentDictionary<long, GetPlaylistContentsQueryParamType>(_knownValues);
private GetPlaylistContentsQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetPlaylistContentsQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetPlaylistContentsQueryParamType(value));
}
public static implicit operator GetPlaylistContentsQueryParamType(long value) => Of(value);
public static implicit operator long(GetPlaylistContentsQueryParamType getplaylistcontentsqueryparamtype) => getplaylistcontentsqueryparamtype.Value;
public static GetPlaylistContentsQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetPlaylistContentsQueryParamType);
public bool Equals(GetPlaylistContentsQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetPlaylistContentsRequest
{

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetPlaylistsRequest
{

View File

@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetRecentlyAddedHubsResponseType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetRecentlyAddedHubsResponseTypeExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetRecentlyAddedHubsResponseType : IEquatable<GetRecentlyAddedHubsResponseType>
{
public static string Value(this GetRecentlyAddedHubsResponseType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetRecentlyAddedHubsResponseType CoverPoster = new GetRecentlyAddedHubsResponseType("coverPoster");
public static readonly GetRecentlyAddedHubsResponseType Background = new GetRecentlyAddedHubsResponseType("background");
public static readonly GetRecentlyAddedHubsResponseType Snapshot = new GetRecentlyAddedHubsResponseType("snapshot");
public static readonly GetRecentlyAddedHubsResponseType ClearLogo = new GetRecentlyAddedHubsResponseType("clearLogo");
public static GetRecentlyAddedHubsResponseType ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedHubsResponseType).GetFields())
private static readonly Dictionary <string, GetRecentlyAddedHubsResponseType> _knownValues =
new Dictionary <string, GetRecentlyAddedHubsResponseType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetRecentlyAddedHubsResponseType> _values =
new ConcurrentDictionary<string, GetRecentlyAddedHubsResponseType>(_knownValues);
if (enumVal is GetRecentlyAddedHubsResponseType)
{
return (GetRecentlyAddedHubsResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsResponseType");
private GetRecentlyAddedHubsResponseType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetRecentlyAddedHubsResponseType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetRecentlyAddedHubsResponseType(value));
}
public static implicit operator GetRecentlyAddedHubsResponseType(string value) => Of(value);
public static implicit operator string(GetRecentlyAddedHubsResponseType getrecentlyaddedhubsresponsetype) => getrecentlyaddedhubsresponsetype.Value;
public static GetRecentlyAddedHubsResponseType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetRecentlyAddedHubsResponseType);
public bool Equals(GetRecentlyAddedHubsResponseType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
@@ -20,61 +23,76 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetRecentlyAddedHubsType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetRecentlyAddedHubsType : IEquatable<GetRecentlyAddedHubsType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetRecentlyAddedHubsType Movie = new GetRecentlyAddedHubsType("movie");
public static readonly GetRecentlyAddedHubsType TvShow = new GetRecentlyAddedHubsType("show");
public static readonly GetRecentlyAddedHubsType Season = new GetRecentlyAddedHubsType("season");
public static readonly GetRecentlyAddedHubsType Episode = new GetRecentlyAddedHubsType("episode");
public static readonly GetRecentlyAddedHubsType Artist = new GetRecentlyAddedHubsType("artist");
public static readonly GetRecentlyAddedHubsType Album = new GetRecentlyAddedHubsType("album");
public static readonly GetRecentlyAddedHubsType Track = new GetRecentlyAddedHubsType("track");
public static readonly GetRecentlyAddedHubsType PhotoAlbum = new GetRecentlyAddedHubsType("photoalbum");
public static readonly GetRecentlyAddedHubsType Photo = new GetRecentlyAddedHubsType("photo");
public static readonly GetRecentlyAddedHubsType Collection = new GetRecentlyAddedHubsType("collection");
public static class GetRecentlyAddedHubsTypeExtension
{
public static string Value(this GetRecentlyAddedHubsType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetRecentlyAddedHubsType ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedHubsType).GetFields())
private static readonly Dictionary <string, GetRecentlyAddedHubsType> _knownValues =
new Dictionary <string, GetRecentlyAddedHubsType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetRecentlyAddedHubsType> _values =
new ConcurrentDictionary<string, GetRecentlyAddedHubsType>(_knownValues);
if (enumVal is GetRecentlyAddedHubsType)
{
return (GetRecentlyAddedHubsType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsType");
private GetRecentlyAddedHubsType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetRecentlyAddedHubsType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetRecentlyAddedHubsType(value));
}
public static implicit operator GetRecentlyAddedHubsType(string value) => Of(value);
public static implicit operator string(GetRecentlyAddedHubsType getrecentlyaddedhubstype) => getrecentlyaddedhubstype.Value;
public static GetRecentlyAddedHubsType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetRecentlyAddedHubsType);
public bool Equals(GetRecentlyAddedHubsType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetRecentlyAddedImage
{

View File

@@ -11,7 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetRecentlyAddedLibraryRequest
{

View File

@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetRecentlyAddedRequest
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
///
@@ -20,47 +23,62 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetSearchAllLibrariesFlattenSeasons
[JsonConverter(typeof(OpenEnumConverter))]
public class GetSearchAllLibrariesFlattenSeasons : IEquatable<GetSearchAllLibrariesFlattenSeasons>
{
[JsonProperty("-1")]
LibraryDefault,
[JsonProperty("0")]
Hide,
[JsonProperty("1")]
Show,
}
public static readonly GetSearchAllLibrariesFlattenSeasons LibraryDefault = new GetSearchAllLibrariesFlattenSeasons("-1");
public static readonly GetSearchAllLibrariesFlattenSeasons Hide = new GetSearchAllLibrariesFlattenSeasons("0");
public static readonly GetSearchAllLibrariesFlattenSeasons Show = new GetSearchAllLibrariesFlattenSeasons("1");
public static class GetSearchAllLibrariesFlattenSeasonsExtension
{
public static string Value(this GetSearchAllLibrariesFlattenSeasons value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesFlattenSeasons ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesFlattenSeasons).GetFields())
private static readonly Dictionary <string, GetSearchAllLibrariesFlattenSeasons> _knownValues =
new Dictionary <string, GetSearchAllLibrariesFlattenSeasons> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["-1"] = LibraryDefault,
["0"] = Hide,
["1"] = Show
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesFlattenSeasons> _values =
new ConcurrentDictionary<string, GetSearchAllLibrariesFlattenSeasons>(_knownValues);
if (enumVal is GetSearchAllLibrariesFlattenSeasons)
{
return (GetSearchAllLibrariesFlattenSeasons)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesFlattenSeasons");
private GetSearchAllLibrariesFlattenSeasons(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetSearchAllLibrariesFlattenSeasons Of(string value)
{
return _values.GetOrAdd(value, _ => new GetSearchAllLibrariesFlattenSeasons(value));
}
public static implicit operator GetSearchAllLibrariesFlattenSeasons(string value) => Of(value);
public static implicit operator string(GetSearchAllLibrariesFlattenSeasons getsearchalllibrariesflattenseasons) => getsearchalllibrariesflattenseasons.Value;
public static GetSearchAllLibrariesFlattenSeasons[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetSearchAllLibrariesFlattenSeasons);
public bool Equals(GetSearchAllLibrariesFlattenSeasons? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetSearchAllLibrariesImage
{

View File

@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetSearchAllLibrariesLibraryType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetSearchAllLibrariesLibraryTypeExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetSearchAllLibrariesLibraryType : IEquatable<GetSearchAllLibrariesLibraryType>
{
public static string Value(this GetSearchAllLibrariesLibraryType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetSearchAllLibrariesLibraryType CoverPoster = new GetSearchAllLibrariesLibraryType("coverPoster");
public static readonly GetSearchAllLibrariesLibraryType Background = new GetSearchAllLibrariesLibraryType("background");
public static readonly GetSearchAllLibrariesLibraryType Snapshot = new GetSearchAllLibrariesLibraryType("snapshot");
public static readonly GetSearchAllLibrariesLibraryType ClearLogo = new GetSearchAllLibrariesLibraryType("clearLogo");
public static GetSearchAllLibrariesLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesLibraryType).GetFields())
private static readonly Dictionary <string, GetSearchAllLibrariesLibraryType> _knownValues =
new Dictionary <string, GetSearchAllLibrariesLibraryType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesLibraryType> _values =
new ConcurrentDictionary<string, GetSearchAllLibrariesLibraryType>(_knownValues);
if (enumVal is GetSearchAllLibrariesLibraryType)
{
return (GetSearchAllLibrariesLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesLibraryType");
private GetSearchAllLibrariesLibraryType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetSearchAllLibrariesLibraryType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetSearchAllLibrariesLibraryType(value));
}
public static implicit operator GetSearchAllLibrariesLibraryType(string value) => Of(value);
public static implicit operator string(GetSearchAllLibrariesLibraryType getsearchalllibrarieslibrarytype) => getsearchalllibrarieslibrarytype.Value;
public static GetSearchAllLibrariesLibraryType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetSearchAllLibrariesLibraryType);
public bool Equals(GetSearchAllLibrariesLibraryType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>

View File

@@ -11,7 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetSearchAllLibrariesRequest
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Setting that indicates the episode ordering for the show.<br/>
///
@@ -26,51 +29,66 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetSearchAllLibrariesShowOrdering
[JsonConverter(typeof(OpenEnumConverter))]
public class GetSearchAllLibrariesShowOrdering : IEquatable<GetSearchAllLibrariesShowOrdering>
{
[JsonProperty("None")]
None,
[JsonProperty("tmdbAiring")]
TmdbAiring,
[JsonProperty("aired")]
TvdbAired,
[JsonProperty("dvd")]
TvdbDvd,
[JsonProperty("absolute")]
TvdbAbsolute,
}
public static readonly GetSearchAllLibrariesShowOrdering None = new GetSearchAllLibrariesShowOrdering("None");
public static readonly GetSearchAllLibrariesShowOrdering TmdbAiring = new GetSearchAllLibrariesShowOrdering("tmdbAiring");
public static readonly GetSearchAllLibrariesShowOrdering TvdbAired = new GetSearchAllLibrariesShowOrdering("aired");
public static readonly GetSearchAllLibrariesShowOrdering TvdbDvd = new GetSearchAllLibrariesShowOrdering("dvd");
public static readonly GetSearchAllLibrariesShowOrdering TvdbAbsolute = new GetSearchAllLibrariesShowOrdering("absolute");
public static class GetSearchAllLibrariesShowOrderingExtension
{
public static string Value(this GetSearchAllLibrariesShowOrdering value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesShowOrdering ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesShowOrdering).GetFields())
private static readonly Dictionary <string, GetSearchAllLibrariesShowOrdering> _knownValues =
new Dictionary <string, GetSearchAllLibrariesShowOrdering> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["None"] = None,
["tmdbAiring"] = TmdbAiring,
["aired"] = TvdbAired,
["dvd"] = TvdbDvd,
["absolute"] = TvdbAbsolute
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesShowOrdering> _values =
new ConcurrentDictionary<string, GetSearchAllLibrariesShowOrdering>(_knownValues);
if (enumVal is GetSearchAllLibrariesShowOrdering)
{
return (GetSearchAllLibrariesShowOrdering)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesShowOrdering");
private GetSearchAllLibrariesShowOrdering(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetSearchAllLibrariesShowOrdering Of(string value)
{
return _values.GetOrAdd(value, _ => new GetSearchAllLibrariesShowOrdering(value));
}
public static implicit operator GetSearchAllLibrariesShowOrdering(string value) => Of(value);
public static implicit operator string(GetSearchAllLibrariesShowOrdering getsearchalllibrariesshowordering) => getsearchalllibrariesshowordering.Value;
public static GetSearchAllLibrariesShowOrdering[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetSearchAllLibrariesShowOrdering);
public bool Equals(GetSearchAllLibrariesShowOrdering? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
@@ -20,61 +23,76 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetSearchAllLibrariesType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetSearchAllLibrariesType : IEquatable<GetSearchAllLibrariesType>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static readonly GetSearchAllLibrariesType Movie = new GetSearchAllLibrariesType("movie");
public static readonly GetSearchAllLibrariesType TvShow = new GetSearchAllLibrariesType("show");
public static readonly GetSearchAllLibrariesType Season = new GetSearchAllLibrariesType("season");
public static readonly GetSearchAllLibrariesType Episode = new GetSearchAllLibrariesType("episode");
public static readonly GetSearchAllLibrariesType Artist = new GetSearchAllLibrariesType("artist");
public static readonly GetSearchAllLibrariesType Album = new GetSearchAllLibrariesType("album");
public static readonly GetSearchAllLibrariesType Track = new GetSearchAllLibrariesType("track");
public static readonly GetSearchAllLibrariesType PhotoAlbum = new GetSearchAllLibrariesType("photoalbum");
public static readonly GetSearchAllLibrariesType Photo = new GetSearchAllLibrariesType("photo");
public static readonly GetSearchAllLibrariesType Collection = new GetSearchAllLibrariesType("collection");
public static class GetSearchAllLibrariesTypeExtension
{
public static string Value(this GetSearchAllLibrariesType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesType ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesType).GetFields())
private static readonly Dictionary <string, GetSearchAllLibrariesType> _knownValues =
new Dictionary <string, GetSearchAllLibrariesType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesType> _values =
new ConcurrentDictionary<string, GetSearchAllLibrariesType>(_knownValues);
if (enumVal is GetSearchAllLibrariesType)
{
return (GetSearchAllLibrariesType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesType");
private GetSearchAllLibrariesType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetSearchAllLibrariesType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetSearchAllLibrariesType(value));
}
public static implicit operator GetSearchAllLibrariesType(string value) => Of(value);
public static implicit operator string(GetSearchAllLibrariesType getsearchalllibrariestype) => getsearchalllibrariestype.Value;
public static GetSearchAllLibrariesType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetSearchAllLibrariesType);
public bool Equals(GetSearchAllLibrariesType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetSearchLibraryQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetSearchLibraryQueryParamType : IEquatable<GetSearchLibraryQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetSearchLibraryQueryParamType Movie = new GetSearchLibraryQueryParamType(1);
public static readonly GetSearchLibraryQueryParamType TvShow = new GetSearchLibraryQueryParamType(2);
public static readonly GetSearchLibraryQueryParamType Season = new GetSearchLibraryQueryParamType(3);
public static readonly GetSearchLibraryQueryParamType Episode = new GetSearchLibraryQueryParamType(4);
public static readonly GetSearchLibraryQueryParamType Artist = new GetSearchLibraryQueryParamType(5);
public static readonly GetSearchLibraryQueryParamType Album = new GetSearchLibraryQueryParamType(6);
public static readonly GetSearchLibraryQueryParamType Track = new GetSearchLibraryQueryParamType(7);
public static readonly GetSearchLibraryQueryParamType PhotoAlbum = new GetSearchLibraryQueryParamType(8);
public static readonly GetSearchLibraryQueryParamType Photo = new GetSearchLibraryQueryParamType(9);
private static readonly Dictionary <long, GetSearchLibraryQueryParamType> _knownValues =
new Dictionary <long, GetSearchLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetSearchLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetSearchLibraryQueryParamType>(_knownValues);
private GetSearchLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetSearchLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetSearchLibraryQueryParamType(value));
}
public static implicit operator GetSearchLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetSearchLibraryQueryParamType getsearchlibraryqueryparamtype) => getsearchlibraryqueryparamtype.Value;
public static GetSearchLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetSearchLibraryQueryParamType);
public bool Equals(GetSearchLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetSearchLibraryRequest
{

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetTimelineRequest
{

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum GetTokenDetailsAuthenticationResponseStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class GetTokenDetailsAuthenticationResponseStatus : IEquatable<GetTokenDetailsAuthenticationResponseStatus>
{
[JsonProperty("Inactive")]
Inactive,
[JsonProperty("Active")]
Active,
}
public static readonly GetTokenDetailsAuthenticationResponseStatus Inactive = new GetTokenDetailsAuthenticationResponseStatus("Inactive");
public static readonly GetTokenDetailsAuthenticationResponseStatus Active = new GetTokenDetailsAuthenticationResponseStatus("Active");
public static class GetTokenDetailsAuthenticationResponseStatusExtension
{
public static string Value(this GetTokenDetailsAuthenticationResponseStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetTokenDetailsAuthenticationResponseStatus ToEnum(this string value)
{
foreach(var field in typeof(GetTokenDetailsAuthenticationResponseStatus).GetFields())
private static readonly Dictionary <string, GetTokenDetailsAuthenticationResponseStatus> _knownValues =
new Dictionary <string, GetTokenDetailsAuthenticationResponseStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["Inactive"] = Inactive,
["Active"] = Active
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetTokenDetailsAuthenticationResponseStatus> _values =
new ConcurrentDictionary<string, GetTokenDetailsAuthenticationResponseStatus>(_knownValues);
if (enumVal is GetTokenDetailsAuthenticationResponseStatus)
{
return (GetTokenDetailsAuthenticationResponseStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetTokenDetailsAuthenticationResponseStatus");
private GetTokenDetailsAuthenticationResponseStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetTokenDetailsAuthenticationResponseStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new GetTokenDetailsAuthenticationResponseStatus(value));
}
public static implicit operator GetTokenDetailsAuthenticationResponseStatus(string value) => Of(value);
public static implicit operator string(GetTokenDetailsAuthenticationResponseStatus gettokendetailsauthenticationresponsestatus) => gettokendetailsauthenticationresponsestatus.Value;
public static GetTokenDetailsAuthenticationResponseStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetTokenDetailsAuthenticationResponseStatus);
public bool Equals(GetTokenDetailsAuthenticationResponseStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum GetTokenDetailsAuthenticationStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class GetTokenDetailsAuthenticationStatus : IEquatable<GetTokenDetailsAuthenticationStatus>
{
[JsonProperty("Inactive")]
Inactive,
[JsonProperty("Active")]
Active,
}
public static readonly GetTokenDetailsAuthenticationStatus Inactive = new GetTokenDetailsAuthenticationStatus("Inactive");
public static readonly GetTokenDetailsAuthenticationStatus Active = new GetTokenDetailsAuthenticationStatus("Active");
public static class GetTokenDetailsAuthenticationStatusExtension
{
public static string Value(this GetTokenDetailsAuthenticationStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetTokenDetailsAuthenticationStatus ToEnum(this string value)
{
foreach(var field in typeof(GetTokenDetailsAuthenticationStatus).GetFields())
private static readonly Dictionary <string, GetTokenDetailsAuthenticationStatus> _knownValues =
new Dictionary <string, GetTokenDetailsAuthenticationStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["Inactive"] = Inactive,
["Active"] = Active
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetTokenDetailsAuthenticationStatus> _values =
new ConcurrentDictionary<string, GetTokenDetailsAuthenticationStatus>(_knownValues);
if (enumVal is GetTokenDetailsAuthenticationStatus)
{
return (GetTokenDetailsAuthenticationStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetTokenDetailsAuthenticationStatus");
private GetTokenDetailsAuthenticationStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetTokenDetailsAuthenticationStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new GetTokenDetailsAuthenticationStatus(value));
}
public static implicit operator GetTokenDetailsAuthenticationStatus(string value) => Of(value);
public static implicit operator string(GetTokenDetailsAuthenticationStatus gettokendetailsauthenticationstatus) => gettokendetailsauthenticationstatus.Value;
public static GetTokenDetailsAuthenticationStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetTokenDetailsAuthenticationStatus);
public bool Equals(GetTokenDetailsAuthenticationStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,46 +12,64 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetTokenDetailsStatus
{
[JsonProperty("online")]
Online,
[JsonProperty("offline")]
Offline,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class GetTokenDetailsStatusExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class GetTokenDetailsStatus : IEquatable<GetTokenDetailsStatus>
{
public static string Value(this GetTokenDetailsStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly GetTokenDetailsStatus Online = new GetTokenDetailsStatus("online");
public static readonly GetTokenDetailsStatus Offline = new GetTokenDetailsStatus("offline");
public static GetTokenDetailsStatus ToEnum(this string value)
{
foreach(var field in typeof(GetTokenDetailsStatus).GetFields())
private static readonly Dictionary <string, GetTokenDetailsStatus> _knownValues =
new Dictionary <string, GetTokenDetailsStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["online"] = Online,
["offline"] = Offline
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, GetTokenDetailsStatus> _values =
new ConcurrentDictionary<string, GetTokenDetailsStatus>(_knownValues);
if (enumVal is GetTokenDetailsStatus)
{
return (GetTokenDetailsStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetTokenDetailsStatus");
private GetTokenDetailsStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetTokenDetailsStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new GetTokenDetailsStatus(value));
}
public static implicit operator GetTokenDetailsStatus(string value) => Of(value);
public static implicit operator string(GetTokenDetailsStatus gettokendetailsstatus) => gettokendetailsstatus.Value;
public static GetTokenDetailsStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetTokenDetailsStatus);
public bool Equals(GetTokenDetailsStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetTokenDetailsSubscription
{

View File

@@ -13,7 +13,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Logged in user details

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum GetTopWatchedContentQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class GetTopWatchedContentQueryParamType : IEquatable<GetTopWatchedContentQueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly GetTopWatchedContentQueryParamType Movie = new GetTopWatchedContentQueryParamType(1);
public static readonly GetTopWatchedContentQueryParamType TvShow = new GetTopWatchedContentQueryParamType(2);
public static readonly GetTopWatchedContentQueryParamType Season = new GetTopWatchedContentQueryParamType(3);
public static readonly GetTopWatchedContentQueryParamType Episode = new GetTopWatchedContentQueryParamType(4);
public static readonly GetTopWatchedContentQueryParamType Artist = new GetTopWatchedContentQueryParamType(5);
public static readonly GetTopWatchedContentQueryParamType Album = new GetTopWatchedContentQueryParamType(6);
public static readonly GetTopWatchedContentQueryParamType Track = new GetTopWatchedContentQueryParamType(7);
public static readonly GetTopWatchedContentQueryParamType PhotoAlbum = new GetTopWatchedContentQueryParamType(8);
public static readonly GetTopWatchedContentQueryParamType Photo = new GetTopWatchedContentQueryParamType(9);
private static readonly Dictionary <long, GetTopWatchedContentQueryParamType> _knownValues =
new Dictionary <long, GetTopWatchedContentQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetTopWatchedContentQueryParamType> _values =
new ConcurrentDictionary<long, GetTopWatchedContentQueryParamType>(_knownValues);
private GetTopWatchedContentQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetTopWatchedContentQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetTopWatchedContentQueryParamType(value));
}
public static implicit operator GetTopWatchedContentQueryParamType(long value) => Of(value);
public static implicit operator long(GetTopWatchedContentQueryParamType gettopwatchedcontentqueryparamtype) => gettopwatchedcontentqueryparamtype.Value;
public static GetTopWatchedContentQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetTopWatchedContentQueryParamType);
public bool Equals(GetTopWatchedContentQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetTopWatchedContentRequest
{

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetWatchListRequest
{

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// An integer log level to write to the PMS log with.<br/>
///
@@ -23,13 +28,65 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum Level
[JsonConverter(typeof(OpenEnumConverter))]
public class Level : IEquatable<Level>
{
Zero = 0,
One = 1,
Two = 2,
Three = 3,
Four = 4,
public static readonly Level Zero = new Level(0);
public static readonly Level One = new Level(1);
public static readonly Level Two = new Level(2);
public static readonly Level Three = new Level(3);
public static readonly Level Four = new Level(4);
private static readonly Dictionary <long, Level> _knownValues =
new Dictionary <long, Level> ()
{
[0] = Zero,
[1] = One,
[2] = Two,
[3] = Three,
[4] = Four
};
private static readonly ConcurrentDictionary<long, Level> _values =
new ConcurrentDictionary<long, Level>(_knownValues);
private Level(long value)
{
Value = value;
}
public long Value { get; }
public static Level Of(long value)
{
return _values.GetOrAdd(value, _ => new Level(value));
}
public static implicit operator Level(long value) => Of(value);
public static implicit operator long(Level level) => level.Value;
public static Level[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Level);
public bool Equals(Level? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of library to filter. Can be &quot;movie&quot; or &quot;show&quot;, or all if not present.<br/>
///
@@ -20,45 +23,60 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum Libtype
[JsonConverter(typeof(OpenEnumConverter))]
public class Libtype : IEquatable<Libtype>
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
Show,
}
public static readonly Libtype Movie = new Libtype("movie");
public static readonly Libtype Show = new Libtype("show");
public static class LibtypeExtension
{
public static string Value(this Libtype value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Libtype ToEnum(this string value)
{
foreach(var field in typeof(Libtype).GetFields())
private static readonly Dictionary <string, Libtype> _knownValues =
new Dictionary <string, Libtype> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movie"] = Movie,
["show"] = Show
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, Libtype> _values =
new ConcurrentDictionary<string, Libtype>(_knownValues);
if (enumVal is Libtype)
{
return (Libtype)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Libtype");
private Libtype(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static Libtype Of(string value)
{
return _values.GetOrAdd(value, _ => new Libtype(value));
}
public static implicit operator Libtype(string value) => Of(value);
public static implicit operator string(Libtype libtype) => libtype.Value;
public static Libtype[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Libtype);
public bool Equals(Libtype? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class LogLineRequest
{

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Your current mailing list status (active or unsubscribed)
/// </summary>
public enum MailingListStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class MailingListStatus : IEquatable<MailingListStatus>
{
[JsonProperty("active")]
Active,
[JsonProperty("unsubscribed")]
Unsubscribed,
}
public static readonly MailingListStatus Active = new MailingListStatus("active");
public static readonly MailingListStatus Unsubscribed = new MailingListStatus("unsubscribed");
public static class MailingListStatusExtension
{
public static string Value(this MailingListStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static MailingListStatus ToEnum(this string value)
{
foreach(var field in typeof(MailingListStatus).GetFields())
private static readonly Dictionary <string, MailingListStatus> _knownValues =
new Dictionary <string, MailingListStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["active"] = Active,
["unsubscribed"] = Unsubscribed
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, MailingListStatus> _values =
new ConcurrentDictionary<string, MailingListStatus>(_knownValues);
if (enumVal is MailingListStatus)
{
return (MailingListStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum MailingListStatus");
private MailingListStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static MailingListStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new MailingListStatus(value));
}
public static implicit operator MailingListStatus(string value) => Of(value);
public static implicit operator string(MailingListStatus mailingliststatus) => mailingliststatus.Value;
public static MailingListStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as MailingListStatus);
public bool Equals(MailingListStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class PastSubscription
{

View File

@@ -12,73 +12,91 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The name of the task to be started.
/// </summary>
public enum PathParamTaskName
[JsonConverter(typeof(OpenEnumConverter))]
public class PathParamTaskName : IEquatable<PathParamTaskName>
{
[JsonProperty("BackupDatabase")]
BackupDatabase,
[JsonProperty("BuildGracenoteCollections")]
BuildGracenoteCollections,
[JsonProperty("CheckForUpdates")]
CheckForUpdates,
[JsonProperty("CleanOldBundles")]
CleanOldBundles,
[JsonProperty("CleanOldCacheFiles")]
CleanOldCacheFiles,
[JsonProperty("DeepMediaAnalysis")]
DeepMediaAnalysis,
[JsonProperty("GenerateAutoTags")]
GenerateAutoTags,
[JsonProperty("GenerateChapterThumbs")]
GenerateChapterThumbs,
[JsonProperty("GenerateMediaIndexFiles")]
GenerateMediaIndexFiles,
[JsonProperty("OptimizeDatabase")]
OptimizeDatabase,
[JsonProperty("RefreshLibraries")]
RefreshLibraries,
[JsonProperty("RefreshLocalMedia")]
RefreshLocalMedia,
[JsonProperty("RefreshPeriodicMetadata")]
RefreshPeriodicMetadata,
[JsonProperty("UpgradeMediaAnalysis")]
UpgradeMediaAnalysis,
}
public static readonly PathParamTaskName BackupDatabase = new PathParamTaskName("BackupDatabase");
public static readonly PathParamTaskName BuildGracenoteCollections = new PathParamTaskName("BuildGracenoteCollections");
public static readonly PathParamTaskName CheckForUpdates = new PathParamTaskName("CheckForUpdates");
public static readonly PathParamTaskName CleanOldBundles = new PathParamTaskName("CleanOldBundles");
public static readonly PathParamTaskName CleanOldCacheFiles = new PathParamTaskName("CleanOldCacheFiles");
public static readonly PathParamTaskName DeepMediaAnalysis = new PathParamTaskName("DeepMediaAnalysis");
public static readonly PathParamTaskName GenerateAutoTags = new PathParamTaskName("GenerateAutoTags");
public static readonly PathParamTaskName GenerateChapterThumbs = new PathParamTaskName("GenerateChapterThumbs");
public static readonly PathParamTaskName GenerateMediaIndexFiles = new PathParamTaskName("GenerateMediaIndexFiles");
public static readonly PathParamTaskName OptimizeDatabase = new PathParamTaskName("OptimizeDatabase");
public static readonly PathParamTaskName RefreshLibraries = new PathParamTaskName("RefreshLibraries");
public static readonly PathParamTaskName RefreshLocalMedia = new PathParamTaskName("RefreshLocalMedia");
public static readonly PathParamTaskName RefreshPeriodicMetadata = new PathParamTaskName("RefreshPeriodicMetadata");
public static readonly PathParamTaskName UpgradeMediaAnalysis = new PathParamTaskName("UpgradeMediaAnalysis");
public static class PathParamTaskNameExtension
{
public static string Value(this PathParamTaskName value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PathParamTaskName ToEnum(this string value)
{
foreach(var field in typeof(PathParamTaskName).GetFields())
private static readonly Dictionary <string, PathParamTaskName> _knownValues =
new Dictionary <string, PathParamTaskName> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["BackupDatabase"] = BackupDatabase,
["BuildGracenoteCollections"] = BuildGracenoteCollections,
["CheckForUpdates"] = CheckForUpdates,
["CleanOldBundles"] = CleanOldBundles,
["CleanOldCacheFiles"] = CleanOldCacheFiles,
["DeepMediaAnalysis"] = DeepMediaAnalysis,
["GenerateAutoTags"] = GenerateAutoTags,
["GenerateChapterThumbs"] = GenerateChapterThumbs,
["GenerateMediaIndexFiles"] = GenerateMediaIndexFiles,
["OptimizeDatabase"] = OptimizeDatabase,
["RefreshLibraries"] = RefreshLibraries,
["RefreshLocalMedia"] = RefreshLocalMedia,
["RefreshPeriodicMetadata"] = RefreshPeriodicMetadata,
["UpgradeMediaAnalysis"] = UpgradeMediaAnalysis
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PathParamTaskName> _values =
new ConcurrentDictionary<string, PathParamTaskName>(_knownValues);
if (enumVal is PathParamTaskName)
{
return (PathParamTaskName)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PathParamTaskName");
private PathParamTaskName(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PathParamTaskName Of(string value)
{
return _values.GetOrAdd(value, _ => new PathParamTaskName(value));
}
public static implicit operator PathParamTaskName(string value) => Of(value);
public static implicit operator string(PathParamTaskName pathparamtaskname) => pathparamtaskname.Value;
public static PathParamTaskName[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PathParamTaskName);
public bool Equals(PathParamTaskName? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// limit to a type of playlist.
/// </summary>
public enum PlaylistType
[JsonConverter(typeof(OpenEnumConverter))]
public class PlaylistType : IEquatable<PlaylistType>
{
[JsonProperty("audio")]
Audio,
[JsonProperty("video")]
Video,
[JsonProperty("photo")]
Photo,
}
public static readonly PlaylistType Audio = new PlaylistType("audio");
public static readonly PlaylistType Video = new PlaylistType("video");
public static readonly PlaylistType Photo = new PlaylistType("photo");
public static class PlaylistTypeExtension
{
public static string Value(this PlaylistType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PlaylistType ToEnum(this string value)
{
foreach(var field in typeof(PlaylistType).GetFields())
private static readonly Dictionary <string, PlaylistType> _knownValues =
new Dictionary <string, PlaylistType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["audio"] = Audio,
["video"] = Video,
["photo"] = Photo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PlaylistType> _values =
new ConcurrentDictionary<string, PlaylistType>(_knownValues);
if (enumVal is PlaylistType)
{
return (PlaylistType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PlaylistType");
private PlaylistType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PlaylistType Of(string value)
{
return _values.GetOrAdd(value, _ => new PlaylistType(value));
}
public static implicit operator PlaylistType(string value) => Of(value);
public static implicit operator string(PlaylistType playlisttype) => playlisttype.Value;
public static PlaylistType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PlaylistType);
public bool Equals(PlaylistType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum PostUsersSignInDataAuthenticationResponseStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class PostUsersSignInDataAuthenticationResponseStatus : IEquatable<PostUsersSignInDataAuthenticationResponseStatus>
{
[JsonProperty("Inactive")]
Inactive,
[JsonProperty("Active")]
Active,
}
public static readonly PostUsersSignInDataAuthenticationResponseStatus Inactive = new PostUsersSignInDataAuthenticationResponseStatus("Inactive");
public static readonly PostUsersSignInDataAuthenticationResponseStatus Active = new PostUsersSignInDataAuthenticationResponseStatus("Active");
public static class PostUsersSignInDataAuthenticationResponseStatusExtension
{
public static string Value(this PostUsersSignInDataAuthenticationResponseStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataAuthenticationResponseStatus ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataAuthenticationResponseStatus).GetFields())
private static readonly Dictionary <string, PostUsersSignInDataAuthenticationResponseStatus> _knownValues =
new Dictionary <string, PostUsersSignInDataAuthenticationResponseStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["Inactive"] = Inactive,
["Active"] = Active
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PostUsersSignInDataAuthenticationResponseStatus> _values =
new ConcurrentDictionary<string, PostUsersSignInDataAuthenticationResponseStatus>(_knownValues);
if (enumVal is PostUsersSignInDataAuthenticationResponseStatus)
{
return (PostUsersSignInDataAuthenticationResponseStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationResponseStatus");
private PostUsersSignInDataAuthenticationResponseStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PostUsersSignInDataAuthenticationResponseStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new PostUsersSignInDataAuthenticationResponseStatus(value));
}
public static implicit operator PostUsersSignInDataAuthenticationResponseStatus(string value) => Of(value);
public static implicit operator string(PostUsersSignInDataAuthenticationResponseStatus postuserssignindataauthenticationresponsestatus) => postuserssignindataauthenticationresponsestatus.Value;
public static PostUsersSignInDataAuthenticationResponseStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PostUsersSignInDataAuthenticationResponseStatus);
public bool Equals(PostUsersSignInDataAuthenticationResponseStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum PostUsersSignInDataAuthenticationStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class PostUsersSignInDataAuthenticationStatus : IEquatable<PostUsersSignInDataAuthenticationStatus>
{
[JsonProperty("Inactive")]
Inactive,
[JsonProperty("Active")]
Active,
}
public static readonly PostUsersSignInDataAuthenticationStatus Inactive = new PostUsersSignInDataAuthenticationStatus("Inactive");
public static readonly PostUsersSignInDataAuthenticationStatus Active = new PostUsersSignInDataAuthenticationStatus("Active");
public static class PostUsersSignInDataAuthenticationStatusExtension
{
public static string Value(this PostUsersSignInDataAuthenticationStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataAuthenticationStatus ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataAuthenticationStatus).GetFields())
private static readonly Dictionary <string, PostUsersSignInDataAuthenticationStatus> _knownValues =
new Dictionary <string, PostUsersSignInDataAuthenticationStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["Inactive"] = Inactive,
["Active"] = Active
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PostUsersSignInDataAuthenticationStatus> _values =
new ConcurrentDictionary<string, PostUsersSignInDataAuthenticationStatus>(_knownValues);
if (enumVal is PostUsersSignInDataAuthenticationStatus)
{
return (PostUsersSignInDataAuthenticationStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationStatus");
private PostUsersSignInDataAuthenticationStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PostUsersSignInDataAuthenticationStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new PostUsersSignInDataAuthenticationStatus(value));
}
public static implicit operator PostUsersSignInDataAuthenticationStatus(string value) => Of(value);
public static implicit operator string(PostUsersSignInDataAuthenticationStatus postuserssignindataauthenticationstatus) => postuserssignindataauthenticationstatus.Value;
public static PostUsersSignInDataAuthenticationStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PostUsersSignInDataAuthenticationStatus);
public bool Equals(PostUsersSignInDataAuthenticationStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class PostUsersSignInDataAuthenticationSubscription
{

View File

@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Your current mailing list status (active or unsubscribed)
/// </summary>
public enum PostUsersSignInDataMailingListStatus
[JsonConverter(typeof(OpenEnumConverter))]
public class PostUsersSignInDataMailingListStatus : IEquatable<PostUsersSignInDataMailingListStatus>
{
[JsonProperty("active")]
Active,
[JsonProperty("unsubscribed")]
Unsubscribed,
}
public static readonly PostUsersSignInDataMailingListStatus Active = new PostUsersSignInDataMailingListStatus("active");
public static readonly PostUsersSignInDataMailingListStatus Unsubscribed = new PostUsersSignInDataMailingListStatus("unsubscribed");
public static class PostUsersSignInDataMailingListStatusExtension
{
public static string Value(this PostUsersSignInDataMailingListStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataMailingListStatus ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataMailingListStatus).GetFields())
private static readonly Dictionary <string, PostUsersSignInDataMailingListStatus> _knownValues =
new Dictionary <string, PostUsersSignInDataMailingListStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["active"] = Active,
["unsubscribed"] = Unsubscribed
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PostUsersSignInDataMailingListStatus> _values =
new ConcurrentDictionary<string, PostUsersSignInDataMailingListStatus>(_knownValues);
if (enumVal is PostUsersSignInDataMailingListStatus)
{
return (PostUsersSignInDataMailingListStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataMailingListStatus");
private PostUsersSignInDataMailingListStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PostUsersSignInDataMailingListStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new PostUsersSignInDataMailingListStatus(value));
}
public static implicit operator PostUsersSignInDataMailingListStatus(string value) => Of(value);
public static implicit operator string(PostUsersSignInDataMailingListStatus postuserssignindatamailingliststatus) => postuserssignindatamailingliststatus.Value;
public static PostUsersSignInDataMailingListStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PostUsersSignInDataMailingListStatus);
public bool Equals(PostUsersSignInDataMailingListStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class PostUsersSignInDataServices
{

View File

@@ -12,44 +12,62 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum PostUsersSignInDataState
{
[JsonProperty("ended")]
Ended,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class PostUsersSignInDataStateExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class PostUsersSignInDataState : IEquatable<PostUsersSignInDataState>
{
public static string Value(this PostUsersSignInDataState value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly PostUsersSignInDataState Ended = new PostUsersSignInDataState("ended");
public static PostUsersSignInDataState ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataState).GetFields())
private static readonly Dictionary <string, PostUsersSignInDataState> _knownValues =
new Dictionary <string, PostUsersSignInDataState> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["ended"] = Ended
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PostUsersSignInDataState> _values =
new ConcurrentDictionary<string, PostUsersSignInDataState>(_knownValues);
if (enumVal is PostUsersSignInDataState)
{
return (PostUsersSignInDataState)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataState");
private PostUsersSignInDataState(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PostUsersSignInDataState Of(string value)
{
return _values.GetOrAdd(value, _ => new PostUsersSignInDataState(value));
}
public static implicit operator PostUsersSignInDataState(string value) => Of(value);
public static implicit operator string(PostUsersSignInDataState postuserssignindatastate) => postuserssignindatastate.Value;
public static PostUsersSignInDataState[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PostUsersSignInDataState);
public bool Equals(PostUsersSignInDataState? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,46 +12,64 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum PostUsersSignInDataStatus
{
[JsonProperty("online")]
Online,
[JsonProperty("offline")]
Offline,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class PostUsersSignInDataStatusExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class PostUsersSignInDataStatus : IEquatable<PostUsersSignInDataStatus>
{
public static string Value(this PostUsersSignInDataStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly PostUsersSignInDataStatus Online = new PostUsersSignInDataStatus("online");
public static readonly PostUsersSignInDataStatus Offline = new PostUsersSignInDataStatus("offline");
public static PostUsersSignInDataStatus ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataStatus).GetFields())
private static readonly Dictionary <string, PostUsersSignInDataStatus> _knownValues =
new Dictionary <string, PostUsersSignInDataStatus> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["online"] = Online,
["offline"] = Offline
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, PostUsersSignInDataStatus> _values =
new ConcurrentDictionary<string, PostUsersSignInDataStatus>(_knownValues);
if (enumVal is PostUsersSignInDataStatus)
{
return (PostUsersSignInDataStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataStatus");
private PostUsersSignInDataStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static PostUsersSignInDataStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new PostUsersSignInDataStatus(value));
}
public static implicit operator PostUsersSignInDataStatus(string value) => Of(value);
public static implicit operator string(PostUsersSignInDataStatus postuserssignindatastatus) => postuserssignindatastatus.Value;
public static PostUsersSignInDataStatus[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as PostUsersSignInDataStatus);
public bool Equals(PostUsersSignInDataStatus? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// If the accounts Plex Pass subscription is active

View File

@@ -13,7 +13,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Returns the user account data with a valid auth token

View File

@@ -10,14 +10,68 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// type of playlists to return (default is all).
/// </summary>
public enum QueryParamSmart
[JsonConverter(typeof(OpenEnumConverter))]
public class QueryParamSmart : IEquatable<QueryParamSmart>
{
Zero = 0,
One = 1,
public static readonly QueryParamSmart Zero = new QueryParamSmart(0);
public static readonly QueryParamSmart One = new QueryParamSmart(1);
private static readonly Dictionary <long, QueryParamSmart> _knownValues =
new Dictionary <long, QueryParamSmart> ()
{
[0] = Zero,
[1] = One
};
private static readonly ConcurrentDictionary<long, QueryParamSmart> _values =
new ConcurrentDictionary<long, QueryParamSmart>(_knownValues);
private QueryParamSmart(long value)
{
Value = value;
}
public long Value { get; }
public static QueryParamSmart Of(long value)
{
return _values.GetOrAdd(value, _ => new QueryParamSmart(value));
}
public static implicit operator QueryParamSmart(long value) => Of(value);
public static implicit operator long(QueryParamSmart queryparamsmart) => queryparamsmart.Value;
public static QueryParamSmart[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as QueryParamSmart);
public bool Equals(QueryParamSmart? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum QueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class QueryParamType : IEquatable<QueryParamType>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly QueryParamType Movie = new QueryParamType(1);
public static readonly QueryParamType TvShow = new QueryParamType(2);
public static readonly QueryParamType Season = new QueryParamType(3);
public static readonly QueryParamType Episode = new QueryParamType(4);
public static readonly QueryParamType Artist = new QueryParamType(5);
public static readonly QueryParamType Album = new QueryParamType(6);
public static readonly QueryParamType Track = new QueryParamType(7);
public static readonly QueryParamType PhotoAlbum = new QueryParamType(8);
public static readonly QueryParamType Photo = new QueryParamType(9);
private static readonly Dictionary <long, QueryParamType> _knownValues =
new Dictionary <long, QueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, QueryParamType> _values =
new ConcurrentDictionary<long, QueryParamType>(_knownValues);
private QueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static QueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new QueryParamType(value));
}
public static implicit operator QueryParamType(long value) => Of(value);
public static implicit operator long(QueryParamType queryparamtype) => queryparamtype.Value;
public static QueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as QueryParamType);
public bool Equals(QueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,52 +12,70 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum SearchTypes
{
[JsonProperty("movies")]
Movies,
[JsonProperty("music")]
Music,
[JsonProperty("otherVideos")]
OtherVideos,
[JsonProperty("people")]
People,
[JsonProperty("tv")]
Tv,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class SearchTypesExtension
[JsonConverter(typeof(OpenEnumConverter))]
public class SearchTypes : IEquatable<SearchTypes>
{
public static string Value(this SearchTypes value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly SearchTypes Movies = new SearchTypes("movies");
public static readonly SearchTypes Music = new SearchTypes("music");
public static readonly SearchTypes OtherVideos = new SearchTypes("otherVideos");
public static readonly SearchTypes People = new SearchTypes("people");
public static readonly SearchTypes Tv = new SearchTypes("tv");
public static SearchTypes ToEnum(this string value)
{
foreach(var field in typeof(SearchTypes).GetFields())
private static readonly Dictionary <string, SearchTypes> _knownValues =
new Dictionary <string, SearchTypes> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["movies"] = Movies,
["music"] = Music,
["otherVideos"] = OtherVideos,
["people"] = People,
["tv"] = Tv
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, SearchTypes> _values =
new ConcurrentDictionary<string, SearchTypes>(_knownValues);
if (enumVal is SearchTypes)
{
return (SearchTypes)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum SearchTypes");
private SearchTypes(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static SearchTypes Of(string value)
{
return _values.GetOrAdd(value, _ => new SearchTypes(value));
}
public static implicit operator SearchTypes(string value) => Of(value);
public static implicit operator string(SearchTypes searchtypes) => searchtypes.Value;
public static SearchTypes[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as SearchTypes);
public bool Equals(SearchTypes? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class Services
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Setting that indicates the episode ordering for the show.<br/>
///
@@ -26,51 +29,66 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum ShowOrdering
[JsonConverter(typeof(OpenEnumConverter))]
public class ShowOrdering : IEquatable<ShowOrdering>
{
[JsonProperty("None")]
None,
[JsonProperty("tmdbAiring")]
TmdbAiring,
[JsonProperty("aired")]
TvdbAired,
[JsonProperty("dvd")]
TvdbDvd,
[JsonProperty("absolute")]
TvdbAbsolute,
}
public static readonly ShowOrdering None = new ShowOrdering("None");
public static readonly ShowOrdering TmdbAiring = new ShowOrdering("tmdbAiring");
public static readonly ShowOrdering TvdbAired = new ShowOrdering("aired");
public static readonly ShowOrdering TvdbDvd = new ShowOrdering("dvd");
public static readonly ShowOrdering TvdbAbsolute = new ShowOrdering("absolute");
public static class ShowOrderingExtension
{
public static string Value(this ShowOrdering value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static ShowOrdering ToEnum(this string value)
{
foreach(var field in typeof(ShowOrdering).GetFields())
private static readonly Dictionary <string, ShowOrdering> _knownValues =
new Dictionary <string, ShowOrdering> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["None"] = None,
["tmdbAiring"] = TmdbAiring,
["aired"] = TvdbAired,
["dvd"] = TvdbDvd,
["absolute"] = TvdbAbsolute
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, ShowOrdering> _values =
new ConcurrentDictionary<string, ShowOrdering>(_knownValues);
if (enumVal is ShowOrdering)
{
return (ShowOrdering)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum ShowOrdering");
private ShowOrdering(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static ShowOrdering Of(string value)
{
return _values.GetOrAdd(value, _ => new ShowOrdering(value));
}
public static implicit operator ShowOrdering(string value) => Of(value);
public static implicit operator string(ShowOrdering showordering) => showordering.Value;
public static ShowOrdering[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as ShowOrdering);
public bool Equals(ShowOrdering? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class StartTaskRequest
{

View File

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The state of the media item
/// </summary>
public enum State
[JsonConverter(typeof(OpenEnumConverter))]
public class State : IEquatable<State>
{
[JsonProperty("playing")]
Playing,
[JsonProperty("paused")]
Paused,
[JsonProperty("stopped")]
Stopped,
}
public static readonly State Playing = new State("playing");
public static readonly State Paused = new State("paused");
public static readonly State Stopped = new State("stopped");
public static class StateExtension
{
public static string Value(this State value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static State ToEnum(this string value)
{
foreach(var field in typeof(State).GetFields())
private static readonly Dictionary <string, State> _knownValues =
new Dictionary <string, State> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["playing"] = Playing,
["paused"] = Paused,
["stopped"] = Stopped
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, State> _values =
new ConcurrentDictionary<string, State>(_knownValues);
if (enumVal is State)
{
return (State)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum State");
private State(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static State Of(string value)
{
return _values.GetOrAdd(value, _ => new State(value));
}
public static implicit operator State(string value) => Of(value);
public static implicit operator string(State state) => state.Value;
public static State[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as State);
public bool Equals(State? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,47 +12,65 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Current friend request status
/// </summary>
public enum Status
[JsonConverter(typeof(OpenEnumConverter))]
public class Status : IEquatable<Status>
{
[JsonProperty("accepted")]
Accepted,
}
public static readonly Status Accepted = new Status("accepted");
public static class StatusExtension
{
public static string Value(this Status value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Status ToEnum(this string value)
{
foreach(var field in typeof(Status).GetFields())
private static readonly Dictionary <string, Status> _knownValues =
new Dictionary <string, Status> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["accepted"] = Accepted
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, Status> _values =
new ConcurrentDictionary<string, Status>(_knownValues);
if (enumVal is Status)
{
return (Status)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Status");
private Status(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static Status Of(string value)
{
return _values.GetOrAdd(value, _ => new Status(value));
}
public static implicit operator Status(string value) => Of(value);
public static implicit operator string(Status status) => status.Value;
public static Status[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Status);
public bool Equals(Status? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class StopTaskRequest
{

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// If the accounts Plex Pass subscription is active

View File

@@ -12,77 +12,95 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// A key representing a specific tag within the section.
/// </summary>
public enum Tag
[JsonConverter(typeof(OpenEnumConverter))]
public class Tag : IEquatable<Tag>
{
[JsonProperty("unwatched")]
Unwatched,
[JsonProperty("newest")]
Newest,
[JsonProperty("recentlyAdded")]
RecentlyAdded,
[JsonProperty("recentlyViewed")]
RecentlyViewed,
[JsonProperty("onDeck")]
OnDeck,
[JsonProperty("collection")]
Collection,
[JsonProperty("edition")]
Edition,
[JsonProperty("year")]
Year,
[JsonProperty("decade")]
Decade,
[JsonProperty("director")]
Director,
[JsonProperty("contentRating")]
ContentRating,
[JsonProperty("rating")]
Rating,
[JsonProperty("resolution")]
Resolution,
[JsonProperty("firstCharacter")]
FirstCharacter,
[JsonProperty("folder")]
Folder,
[JsonProperty("albums")]
Albums,
}
public static readonly Tag Unwatched = new Tag("unwatched");
public static readonly Tag Newest = new Tag("newest");
public static readonly Tag RecentlyAdded = new Tag("recentlyAdded");
public static readonly Tag RecentlyViewed = new Tag("recentlyViewed");
public static readonly Tag OnDeck = new Tag("onDeck");
public static readonly Tag Collection = new Tag("collection");
public static readonly Tag Edition = new Tag("edition");
public static readonly Tag Year = new Tag("year");
public static readonly Tag Decade = new Tag("decade");
public static readonly Tag Director = new Tag("director");
public static readonly Tag ContentRating = new Tag("contentRating");
public static readonly Tag Rating = new Tag("rating");
public static readonly Tag Resolution = new Tag("resolution");
public static readonly Tag FirstCharacter = new Tag("firstCharacter");
public static readonly Tag Folder = new Tag("folder");
public static readonly Tag Albums = new Tag("albums");
public static class TagExtension
{
public static string Value(this Tag value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Tag ToEnum(this string value)
{
foreach(var field in typeof(Tag).GetFields())
private static readonly Dictionary <string, Tag> _knownValues =
new Dictionary <string, Tag> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["unwatched"] = Unwatched,
["newest"] = Newest,
["recentlyAdded"] = RecentlyAdded,
["recentlyViewed"] = RecentlyViewed,
["onDeck"] = OnDeck,
["collection"] = Collection,
["edition"] = Edition,
["year"] = Year,
["decade"] = Decade,
["director"] = Director,
["contentRating"] = ContentRating,
["rating"] = Rating,
["resolution"] = Resolution,
["firstCharacter"] = FirstCharacter,
["folder"] = Folder,
["albums"] = Albums
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, Tag> _values =
new ConcurrentDictionary<string, Tag>(_knownValues);
if (enumVal is Tag)
{
return (Tag)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Tag");
private Tag(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static Tag Of(string value)
{
return _values.GetOrAdd(value, _ => new Tag(value));
}
public static implicit operator Tag(string value) => Of(value);
public static implicit operator string(Tag tag) => tag.Value;
public static Tag[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Tag);
public bool Equals(Tag? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,73 +12,91 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// the name of the task to be started.
/// </summary>
public enum TaskName
[JsonConverter(typeof(OpenEnumConverter))]
public class TaskName : IEquatable<TaskName>
{
[JsonProperty("BackupDatabase")]
BackupDatabase,
[JsonProperty("BuildGracenoteCollections")]
BuildGracenoteCollections,
[JsonProperty("CheckForUpdates")]
CheckForUpdates,
[JsonProperty("CleanOldBundles")]
CleanOldBundles,
[JsonProperty("CleanOldCacheFiles")]
CleanOldCacheFiles,
[JsonProperty("DeepMediaAnalysis")]
DeepMediaAnalysis,
[JsonProperty("GenerateAutoTags")]
GenerateAutoTags,
[JsonProperty("GenerateChapterThumbs")]
GenerateChapterThumbs,
[JsonProperty("GenerateMediaIndexFiles")]
GenerateMediaIndexFiles,
[JsonProperty("OptimizeDatabase")]
OptimizeDatabase,
[JsonProperty("RefreshLibraries")]
RefreshLibraries,
[JsonProperty("RefreshLocalMedia")]
RefreshLocalMedia,
[JsonProperty("RefreshPeriodicMetadata")]
RefreshPeriodicMetadata,
[JsonProperty("UpgradeMediaAnalysis")]
UpgradeMediaAnalysis,
}
public static readonly TaskName BackupDatabase = new TaskName("BackupDatabase");
public static readonly TaskName BuildGracenoteCollections = new TaskName("BuildGracenoteCollections");
public static readonly TaskName CheckForUpdates = new TaskName("CheckForUpdates");
public static readonly TaskName CleanOldBundles = new TaskName("CleanOldBundles");
public static readonly TaskName CleanOldCacheFiles = new TaskName("CleanOldCacheFiles");
public static readonly TaskName DeepMediaAnalysis = new TaskName("DeepMediaAnalysis");
public static readonly TaskName GenerateAutoTags = new TaskName("GenerateAutoTags");
public static readonly TaskName GenerateChapterThumbs = new TaskName("GenerateChapterThumbs");
public static readonly TaskName GenerateMediaIndexFiles = new TaskName("GenerateMediaIndexFiles");
public static readonly TaskName OptimizeDatabase = new TaskName("OptimizeDatabase");
public static readonly TaskName RefreshLibraries = new TaskName("RefreshLibraries");
public static readonly TaskName RefreshLocalMedia = new TaskName("RefreshLocalMedia");
public static readonly TaskName RefreshPeriodicMetadata = new TaskName("RefreshPeriodicMetadata");
public static readonly TaskName UpgradeMediaAnalysis = new TaskName("UpgradeMediaAnalysis");
public static class TaskNameExtension
{
public static string Value(this TaskName value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static TaskName ToEnum(this string value)
{
foreach(var field in typeof(TaskName).GetFields())
private static readonly Dictionary <string, TaskName> _knownValues =
new Dictionary <string, TaskName> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["BackupDatabase"] = BackupDatabase,
["BuildGracenoteCollections"] = BuildGracenoteCollections,
["CheckForUpdates"] = CheckForUpdates,
["CleanOldBundles"] = CleanOldBundles,
["CleanOldCacheFiles"] = CleanOldCacheFiles,
["DeepMediaAnalysis"] = DeepMediaAnalysis,
["GenerateAutoTags"] = GenerateAutoTags,
["GenerateChapterThumbs"] = GenerateChapterThumbs,
["GenerateMediaIndexFiles"] = GenerateMediaIndexFiles,
["OptimizeDatabase"] = OptimizeDatabase,
["RefreshLibraries"] = RefreshLibraries,
["RefreshLocalMedia"] = RefreshLocalMedia,
["RefreshPeriodicMetadata"] = RefreshPeriodicMetadata,
["UpgradeMediaAnalysis"] = UpgradeMediaAnalysis
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, TaskName> _values =
new ConcurrentDictionary<string, TaskName>(_knownValues);
if (enumVal is TaskName)
{
return (TaskName)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum TaskName");
private TaskName(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static TaskName Of(string value)
{
return _values.GetOrAdd(value, _ => new TaskName(value));
}
public static implicit operator TaskName(string value) => Of(value);
public static implicit operator string(TaskName taskname) => taskname.Value;
public static TaskName[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as TaskName);
public bool Equals(TaskName? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -10,7 +10,12 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
///
/// </remarks>
/// </summary>
public enum Type
[JsonConverter(typeof(OpenEnumConverter))]
public class Type : IEquatable<Type>
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Artist = 5,
Album = 6,
Track = 7,
PhotoAlbum = 8,
Photo = 9,
public static readonly Type Movie = new Type(1);
public static readonly Type TvShow = new Type(2);
public static readonly Type Season = new Type(3);
public static readonly Type Episode = new Type(4);
public static readonly Type Artist = new Type(5);
public static readonly Type Album = new Type(6);
public static readonly Type Track = new Type(7);
public static readonly Type PhotoAlbum = new Type(8);
public static readonly Type Photo = new Type(9);
private static readonly Dictionary <long, Type> _knownValues =
new Dictionary <long, Type> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, Type> _values =
new ConcurrentDictionary<long, Type>(_knownValues);
private Type(long value)
{
Value = value;
}
public long Value { get; }
public static Type Of(long value)
{
return _values.GetOrAdd(value, _ => new Type(value));
}
public static implicit operator Type(long value) => Of(value);
public static implicit operator long(Type type) => type.Value;
public static Type[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Type);
public bool Equals(Type? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@@ -146,8 +148,8 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Playlists(SDKConfig config)

View File

@@ -143,8 +143,8 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public Plex(SDKConfig config)

View File

@@ -292,8 +292,8 @@ namespace LukeHagar.PlexAPI.SDK
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.15.1";
private const string _sdkGenVersion = "2.623.0";
private const string _sdkVersion = "0.16.1";
private const string _sdkGenVersion = "2.674.3";
private const string _openapiDocVersion = "0.0.3";
public IServer Server { get; private set; }
public IMedia Media { get; private set; }
@@ -353,7 +353,7 @@ namespace LukeHagar.PlexAPI.SDK
Users = new Users(SDKConfiguration);
}
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
{
if (serverIndex != null)
{

View File

@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK
{"port", "32400"},
},
};
UserAgent = "speakeasy-sdk/csharp 0.15.1 2.623.0 0.0.3 LukeHagar.PlexAPI.SDK";
UserAgent = "speakeasy-sdk/csharp 0.16.1 2.674.3 0.0.3 LukeHagar.PlexAPI.SDK";
SecuritySource = null;
Hooks = new SDKHooks();
RetryConfig = null;

Some files were not shown because too many files have changed in this diff Show More