mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.0
This commit is contained in:
@@ -3,10 +3,10 @@ id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
|
|||||||
management:
|
management:
|
||||||
docChecksum: 77bdddd188d0778dc73b7f7906e1677c
|
docChecksum: 77bdddd188d0778dc73b7f7906e1677c
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: 1.557.0
|
speakeasyVersion: 1.598.0
|
||||||
generationVersion: 2.623.0
|
generationVersion: 2.674.1
|
||||||
releaseVersion: 0.15.1
|
releaseVersion: 0.16.0
|
||||||
configChecksum: 0d77f3a7a510b4818fc2819df5d3ceae
|
configChecksum: 69a83bce477406829fb9572ba9071c8f
|
||||||
repoURL: https://github.com/LukeHagar/plexcsharp.git
|
repoURL: https://github.com/LukeHagar/plexcsharp.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
published: true
|
published: true
|
||||||
@@ -14,7 +14,7 @@ features:
|
|||||||
csharp:
|
csharp:
|
||||||
additionalDependencies: 0.1.0
|
additionalDependencies: 0.1.0
|
||||||
constsAndDefaults: 0.0.1
|
constsAndDefaults: 0.0.1
|
||||||
core: 3.11.0
|
core: 3.11.2
|
||||||
deprecations: 2.81.2
|
deprecations: 2.81.2
|
||||||
enums: 2.82.0
|
enums: 2.82.0
|
||||||
errors: 0.2.1
|
errors: 0.2.1
|
||||||
@@ -28,6 +28,7 @@ features:
|
|||||||
methodServerURLs: 2.82.1
|
methodServerURLs: 2.82.1
|
||||||
nameOverrides: 2.81.2
|
nameOverrides: 2.81.2
|
||||||
nullables: 0.1.1
|
nullables: 0.1.1
|
||||||
|
openEnums: 0.1.0
|
||||||
responseFormat: 0.0.4
|
responseFormat: 0.0.4
|
||||||
sdkHooks: 0.2.0
|
sdkHooks: 0.2.0
|
||||||
unions: 0.2.2
|
unions: 0.2.2
|
||||||
@@ -973,6 +974,7 @@ generatedFiles:
|
|||||||
- LukeHagar/PlexAPI/SDK/Utils/FlexibleObjectDeserializer.cs
|
- LukeHagar/PlexAPI/SDK/Utils/FlexibleObjectDeserializer.cs
|
||||||
- LukeHagar/PlexAPI/SDK/Utils/HeaderSerializer.cs
|
- LukeHagar/PlexAPI/SDK/Utils/HeaderSerializer.cs
|
||||||
- LukeHagar/PlexAPI/SDK/Utils/IsoDateTimeSerializer.cs
|
- LukeHagar/PlexAPI/SDK/Utils/IsoDateTimeSerializer.cs
|
||||||
|
- LukeHagar/PlexAPI/SDK/Utils/OpenEnumConverter.cs
|
||||||
- LukeHagar/PlexAPI/SDK/Utils/RequestBodySerializer.cs
|
- LukeHagar/PlexAPI/SDK/Utils/RequestBodySerializer.cs
|
||||||
- LukeHagar/PlexAPI/SDK/Utils/ResponseBodyDeserializer.cs
|
- LukeHagar/PlexAPI/SDK/Utils/ResponseBodyDeserializer.cs
|
||||||
- LukeHagar/PlexAPI/SDK/Utils/Retries/BackoffStrategy.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}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
get-banner-image:
|
||||||
speakeasy-default-get-banner-image:
|
speakeasy-default-get-banner-image:
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2096,6 +2109,24 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
startUniversalTranscode:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2121,6 +2152,30 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getServerActivities:
|
||||||
speakeasy-default-get-server-activities:
|
speakeasy-default-get-server-activities:
|
||||||
responses:
|
responses:
|
||||||
@@ -2140,6 +2195,15 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getButlerTasks:
|
||||||
speakeasy-default-get-butler-tasks:
|
speakeasy-default-get-butler-tasks:
|
||||||
responses:
|
responses:
|
||||||
@@ -2235,6 +2299,21 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getPin:
|
||||||
"":
|
"":
|
||||||
parameters:
|
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}
|
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":
|
"400":
|
||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 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:
|
getTokenByPinId:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2265,6 +2359,23 @@ examples:
|
|||||||
responses:
|
responses:
|
||||||
"404":
|
"404":
|
||||||
application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]}
|
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:
|
getGlobalHubs:
|
||||||
speakeasy-default-get-global-hubs:
|
speakeasy-default-get-global-hubs:
|
||||||
responses:
|
responses:
|
||||||
@@ -2519,6 +2630,22 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
get-media-meta-data:
|
||||||
speakeasy-default-get-media-meta-data:
|
speakeasy-default-get-media-meta-data:
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2828,6 +2955,23 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getStatistics:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2840,6 +2984,17 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getResourcesStatistics:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2852,6 +3007,17 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getBandwidthStatistics:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -2864,6 +3030,17 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getSessions:
|
||||||
speakeasy-default-get-sessions:
|
speakeasy-default-get-sessions:
|
||||||
responses:
|
responses:
|
||||||
@@ -2956,6 +3133,19 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
getTranscodeSessions:
|
||||||
speakeasy-default-get-transcode-sessions:
|
speakeasy-default-get-transcode-sessions:
|
||||||
responses:
|
responses:
|
||||||
@@ -2994,6 +3184,15 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
applyUpdates:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -3005,6 +3204,16 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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:
|
get-users:
|
||||||
"":
|
"":
|
||||||
parameters:
|
parameters:
|
||||||
@@ -3029,5 +3238,28 @@ examples:
|
|||||||
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 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
|
examplesVersion: 1.0.2
|
||||||
generatedTests: {}
|
generatedTests: {}
|
||||||
|
|||||||
@@ -16,8 +16,12 @@ generation:
|
|||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
oAuth2PasswordEnabled: false
|
oAuth2PasswordEnabled: false
|
||||||
|
tests:
|
||||||
|
generateTests: true
|
||||||
|
generateNewTests: false
|
||||||
|
skipResponseBodyAssertions: false
|
||||||
csharp:
|
csharp:
|
||||||
version: 0.15.1
|
version: 0.16.0
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
author: LukeHagar
|
author: LukeHagar
|
||||||
baseErrorName: PlexAPIError
|
baseErrorName: PlexAPIError
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.557.0
|
speakeasyVersion: 1.598.0
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -16,19 +16,19 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
|
sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
|
||||||
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
|
sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- speakeasy-sdk-regen-1749428820
|
- speakeasy-sdk-regen-1754440055
|
||||||
targets:
|
targets:
|
||||||
plexcsharp:
|
plexcsharp:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df
|
sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
|
||||||
sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b
|
sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
|
||||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||||
codeSamplesRevisionDigest: sha256:3e40165c9db5020b3885878073275cf7a8e9cfc5dc3f4a81b48c209581c6a041
|
codeSamplesRevisionDigest: sha256:c2f97be4e2fb1380a7f91adf6b91cc8a701cd90ffa314ff36785d1aaf58cb01c
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Activities(SDKConfig config)
|
public Activities(SDKConfig config)
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
};
|
};
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Authentication(SDKConfig config)
|
public Authentication(SDKConfig config)
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -101,8 +103,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Butler(SDKConfig config)
|
public Butler(SDKConfig config)
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Hubs(SDKConfig config)
|
public Hubs(SDKConfig config)
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -319,8 +321,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Library(SDKConfig config)
|
public Library(SDKConfig config)
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -94,8 +96,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Log(SDKConfig config)
|
public Log(SDKConfig config)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||||
<Version>0.15.1</Version>
|
<Version>0.16.0</Version>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Authors>LukeHagar</Authors>
|
<Authors>LukeHagar</Authors>
|
||||||
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Media(SDKConfig config)
|
public Media(SDKConfig config)
|
||||||
|
|||||||
@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// type of playlist to create
|
/// type of playlist to create
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum CreatePlaylistQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class CreatePlaylistQueryParamType : IEquatable<CreatePlaylistQueryParamType>
|
||||||
{
|
{
|
||||||
[JsonProperty("audio")]
|
public static readonly CreatePlaylistQueryParamType Audio = new CreatePlaylistQueryParamType("audio");
|
||||||
Audio,
|
public static readonly CreatePlaylistQueryParamType Video = new CreatePlaylistQueryParamType("video");
|
||||||
[JsonProperty("video")]
|
public static readonly CreatePlaylistQueryParamType Photo = new CreatePlaylistQueryParamType("photo");
|
||||||
Video,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CreatePlaylistQueryParamTypeExtension
|
private static readonly Dictionary <string, CreatePlaylistQueryParamType> _knownValues =
|
||||||
{
|
new Dictionary <string, CreatePlaylistQueryParamType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["audio"] = Audio,
|
||||||
if (attributes.Length == 0)
|
["video"] = Video,
|
||||||
{
|
["photo"] = Photo
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, CreatePlaylistQueryParamType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, CreatePlaylistQueryParamType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is CreatePlaylistQueryParamType)
|
private CreatePlaylistQueryParamType(string value)
|
||||||
{
|
{
|
||||||
return (CreatePlaylistQueryParamType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum CreatePlaylistQueryParamType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class CreatePlaylistRequest
|
public class CreatePlaylistRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Filter
|
/// Filter
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Filter
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Filter : IEquatable<Filter>
|
||||||
{
|
{
|
||||||
[JsonProperty("all")]
|
public static readonly Filter All = new Filter("all");
|
||||||
All,
|
public static readonly Filter Available = new Filter("available");
|
||||||
[JsonProperty("available")]
|
public static readonly Filter Released = new Filter("released");
|
||||||
Available,
|
|
||||||
[JsonProperty("released")]
|
|
||||||
Released,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class FilterExtension
|
private static readonly Dictionary <string, Filter> _knownValues =
|
||||||
{
|
new Dictionary <string, Filter> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["all"] = All,
|
||||||
if (attributes.Length == 0)
|
["available"] = Available,
|
||||||
{
|
["released"] = Released
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, Filter> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, Filter>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is Filter)
|
private Filter(string value)
|
||||||
{
|
{
|
||||||
return (Filter)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum Filter");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum FlattenSeasons
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class FlattenSeasons : IEquatable<FlattenSeasons>
|
||||||
{
|
{
|
||||||
[JsonProperty("-1")]
|
public static readonly FlattenSeasons LibraryDefault = new FlattenSeasons("-1");
|
||||||
LibraryDefault,
|
public static readonly FlattenSeasons Hide = new FlattenSeasons("0");
|
||||||
[JsonProperty("0")]
|
public static readonly FlattenSeasons Show = new FlattenSeasons("1");
|
||||||
Hide,
|
|
||||||
[JsonProperty("1")]
|
|
||||||
Show,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class FlattenSeasonsExtension
|
private static readonly Dictionary <string, FlattenSeasons> _knownValues =
|
||||||
{
|
new Dictionary <string, FlattenSeasons> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["-1"] = LibraryDefault,
|
||||||
if (attributes.Length == 0)
|
["0"] = Hide,
|
||||||
{
|
["1"] = Show
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, FlattenSeasons> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, FlattenSeasons>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is FlattenSeasons)
|
private FlattenSeasons(string value)
|
||||||
{
|
{
|
||||||
return (FlattenSeasons)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum FlattenSeasons");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class Friend
|
public class Friend
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetActorsLibraryQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetActorsLibraryQueryParamType : IEquatable<GetActorsLibraryQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetActorsLibraryQueryParamType Episode = new GetActorsLibraryQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetActorsLibraryQueryParamType Artist = new GetActorsLibraryQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetActorsLibraryQueryParamType Album = new GetActorsLibraryQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetActorsLibraryQueryParamType Track = new GetActorsLibraryQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetActorsLibraryQueryParamType PhotoAlbum = new GetActorsLibraryQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetActorsLibraryRequest
|
public class GetActorsLibraryRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetAllLibrariesDirectory
|
public class GetAllLibrariesDirectory
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,65 +12,83 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The library type
|
/// The library type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetAllLibrariesType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetAllLibrariesType : IEquatable<GetAllLibrariesType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
|
||||||
Movie,
|
public static readonly GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetAllLibrariesType Season = new GetAllLibrariesType("season");
|
||||||
TvShow,
|
public static readonly GetAllLibrariesType Episode = new GetAllLibrariesType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetAllLibrariesType Artist = new GetAllLibrariesType("artist");
|
||||||
Season,
|
public static readonly GetAllLibrariesType Album = new GetAllLibrariesType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetAllLibrariesType Track = new GetAllLibrariesType("track");
|
||||||
Episode,
|
public static readonly GetAllLibrariesType PhotoAlbum = new GetAllLibrariesType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetAllLibrariesType Photo = new GetAllLibrariesType("photo");
|
||||||
Artist,
|
public static readonly GetAllLibrariesType Collection = new GetAllLibrariesType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetAllLibrariesTypeExtension
|
private static readonly Dictionary <string, GetAllLibrariesType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetAllLibrariesType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetAllLibrariesType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetAllLibrariesType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetAllLibrariesType)
|
private GetAllLibrariesType(string value)
|
||||||
{
|
{
|
||||||
return (GetAllLibrariesType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetAllLibrariesType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetCountriesLibraryQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetCountriesLibraryQueryParamType : IEquatable<GetCountriesLibraryQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetCountriesLibraryQueryParamType Episode = new GetCountriesLibraryQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetCountriesLibraryQueryParamType Artist = new GetCountriesLibraryQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetCountriesLibraryQueryParamType Album = new GetCountriesLibraryQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetCountriesLibraryQueryParamType Track = new GetCountriesLibraryQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetCountriesLibraryQueryParamType PhotoAlbum = new GetCountriesLibraryQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetCountriesLibraryRequest
|
public class GetCountriesLibraryRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetGenresLibraryQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetGenresLibraryQueryParamType : IEquatable<GetGenresLibraryQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetGenresLibraryQueryParamType Episode = new GetGenresLibraryQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetGenresLibraryQueryParamType Artist = new GetGenresLibraryQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetGenresLibraryQueryParamType Album = new GetGenresLibraryQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetGenresLibraryQueryParamType Track = new GetGenresLibraryQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetGenresLibraryQueryParamType PhotoAlbum = new GetGenresLibraryQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetGenresLibraryRequest
|
public class GetGenresLibraryRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetLibraryItemsImage
|
public class GetLibraryItemsImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetLibraryItemsLibraryResponseType
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("coverPoster")]
|
|
||||||
CoverPoster,
|
|
||||||
[JsonProperty("background")]
|
|
||||||
Background,
|
|
||||||
[JsonProperty("snapshot")]
|
|
||||||
Snapshot,
|
|
||||||
[JsonProperty("clearLogo")]
|
|
||||||
ClearLogo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetLibraryItemsLibraryResponseTypeExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibraryItemsLibraryResponseType : IEquatable<GetLibraryItemsLibraryResponseType>
|
||||||
{
|
{
|
||||||
public static string Value(this GetLibraryItemsLibraryResponseType value)
|
public static readonly GetLibraryItemsLibraryResponseType CoverPoster = new GetLibraryItemsLibraryResponseType("coverPoster");
|
||||||
{
|
public static readonly GetLibraryItemsLibraryResponseType Background = new GetLibraryItemsLibraryResponseType("background");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
public static readonly GetLibraryItemsLibraryResponseType Snapshot = new GetLibraryItemsLibraryResponseType("snapshot");
|
||||||
}
|
public static readonly GetLibraryItemsLibraryResponseType ClearLogo = new GetLibraryItemsLibraryResponseType("clearLogo");
|
||||||
|
|
||||||
public static GetLibraryItemsLibraryResponseType ToEnum(this string value)
|
private static readonly Dictionary <string, GetLibraryItemsLibraryResponseType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetLibraryItemsLibraryResponseType> ()
|
||||||
foreach(var field in typeof(GetLibraryItemsLibraryResponseType).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["coverPoster"] = CoverPoster,
|
||||||
if (attributes.Length == 0)
|
["background"] = Background,
|
||||||
{
|
["snapshot"] = Snapshot,
|
||||||
continue;
|
["clearLogo"] = ClearLogo
|
||||||
}
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetLibraryItemsLibraryResponseType)
|
private GetLibraryItemsLibraryResponseType(string value)
|
||||||
{
|
{
|
||||||
return (GetLibraryItemsLibraryResponseType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryResponseType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown<br/>
|
/// Unknown<br/>
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetLibraryItemsQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibraryItemsQueryParamType : IEquatable<GetLibraryItemsQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetLibraryItemsQueryParamType Movie = new GetLibraryItemsQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetLibraryItemsQueryParamType TvShow = new GetLibraryItemsQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetLibraryItemsQueryParamType Season = new GetLibraryItemsQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetLibraryItemsQueryParamType Episode = new GetLibraryItemsQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetLibraryItemsQueryParamType Artist = new GetLibraryItemsQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetLibraryItemsQueryParamType Album = new GetLibraryItemsQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetLibraryItemsQueryParamType Track = new GetLibraryItemsQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetLibraryItemsQueryParamType PhotoAlbum = new GetLibraryItemsQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetLibraryItemsRequest
|
public class GetLibraryItemsRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetLibraryItemsType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibraryItemsType : IEquatable<GetLibraryItemsType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetLibraryItemsType Movie = new GetLibraryItemsType("movie");
|
||||||
Movie,
|
public static readonly GetLibraryItemsType TvShow = new GetLibraryItemsType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetLibraryItemsType Season = new GetLibraryItemsType("season");
|
||||||
TvShow,
|
public static readonly GetLibraryItemsType Episode = new GetLibraryItemsType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetLibraryItemsType Artist = new GetLibraryItemsType("artist");
|
||||||
Season,
|
public static readonly GetLibraryItemsType Album = new GetLibraryItemsType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetLibraryItemsType Track = new GetLibraryItemsType("track");
|
||||||
Episode,
|
public static readonly GetLibraryItemsType PhotoAlbum = new GetLibraryItemsType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetLibraryItemsType Photo = new GetLibraryItemsType("photo");
|
||||||
Artist,
|
public static readonly GetLibraryItemsType Collection = new GetLibraryItemsType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetLibraryItemsTypeExtension
|
private static readonly Dictionary <string, GetLibraryItemsType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetLibraryItemsType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetLibraryItemsType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetLibraryItemsType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetLibraryItemsType)
|
private GetLibraryItemsType(string value)
|
||||||
{
|
{
|
||||||
return (GetLibraryItemsType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetLibraryItemsType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetLibrarySectionsAllImage
|
public class GetLibrarySectionsAllImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetLibrarySectionsAllLibraryResponseType
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("coverPoster")]
|
|
||||||
CoverPoster,
|
|
||||||
[JsonProperty("background")]
|
|
||||||
Background,
|
|
||||||
[JsonProperty("snapshot")]
|
|
||||||
Snapshot,
|
|
||||||
[JsonProperty("clearLogo")]
|
|
||||||
ClearLogo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetLibrarySectionsAllLibraryResponseTypeExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibrarySectionsAllLibraryResponseType : IEquatable<GetLibrarySectionsAllLibraryResponseType>
|
||||||
{
|
{
|
||||||
public static string Value(this GetLibrarySectionsAllLibraryResponseType value)
|
public static readonly GetLibrarySectionsAllLibraryResponseType CoverPoster = new GetLibrarySectionsAllLibraryResponseType("coverPoster");
|
||||||
{
|
public static readonly GetLibrarySectionsAllLibraryResponseType Background = new GetLibrarySectionsAllLibraryResponseType("background");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
public static readonly GetLibrarySectionsAllLibraryResponseType Snapshot = new GetLibrarySectionsAllLibraryResponseType("snapshot");
|
||||||
}
|
public static readonly GetLibrarySectionsAllLibraryResponseType ClearLogo = new GetLibrarySectionsAllLibraryResponseType("clearLogo");
|
||||||
|
|
||||||
public static GetLibrarySectionsAllLibraryResponseType ToEnum(this string value)
|
private static readonly Dictionary <string, GetLibrarySectionsAllLibraryResponseType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetLibrarySectionsAllLibraryResponseType> ()
|
||||||
foreach(var field in typeof(GetLibrarySectionsAllLibraryResponseType).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["coverPoster"] = CoverPoster,
|
||||||
if (attributes.Length == 0)
|
["background"] = Background,
|
||||||
{
|
["snapshot"] = Snapshot,
|
||||||
continue;
|
["clearLogo"] = ClearLogo
|
||||||
}
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetLibrarySectionsAllLibraryResponseType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetLibrarySectionsAllLibraryResponseType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetLibrarySectionsAllLibraryResponseType)
|
private GetLibrarySectionsAllLibraryResponseType(string value)
|
||||||
{
|
{
|
||||||
return (GetLibrarySectionsAllLibraryResponseType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryResponseType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetLibrarySectionsAllLibraryType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibrarySectionsAllLibraryType : IEquatable<GetLibrarySectionsAllLibraryType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetLibrarySectionsAllLibraryType Movie = new GetLibrarySectionsAllLibraryType("movie");
|
||||||
Movie,
|
public static readonly GetLibrarySectionsAllLibraryType TvShow = new GetLibrarySectionsAllLibraryType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetLibrarySectionsAllLibraryType Season = new GetLibrarySectionsAllLibraryType("season");
|
||||||
TvShow,
|
public static readonly GetLibrarySectionsAllLibraryType Episode = new GetLibrarySectionsAllLibraryType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetLibrarySectionsAllLibraryType Artist = new GetLibrarySectionsAllLibraryType("artist");
|
||||||
Season,
|
public static readonly GetLibrarySectionsAllLibraryType Album = new GetLibrarySectionsAllLibraryType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetLibrarySectionsAllLibraryType Track = new GetLibrarySectionsAllLibraryType("track");
|
||||||
Episode,
|
public static readonly GetLibrarySectionsAllLibraryType PhotoAlbum = new GetLibrarySectionsAllLibraryType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetLibrarySectionsAllLibraryType Photo = new GetLibrarySectionsAllLibraryType("photo");
|
||||||
Artist,
|
public static readonly GetLibrarySectionsAllLibraryType Collection = new GetLibrarySectionsAllLibraryType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetLibrarySectionsAllLibraryTypeExtension
|
private static readonly Dictionary <string, GetLibrarySectionsAllLibraryType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetLibrarySectionsAllLibraryType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetLibrarySectionsAllLibraryType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetLibrarySectionsAllLibraryType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetLibrarySectionsAllLibraryType)
|
private GetLibrarySectionsAllLibraryType(string value)
|
||||||
{
|
{
|
||||||
return (GetLibrarySectionsAllLibraryType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown<br/>
|
/// Unknown<br/>
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetLibrarySectionsAllQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetLibrarySectionsAllQueryParamType : IEquatable<GetLibrarySectionsAllQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetLibrarySectionsAllQueryParamType Movie = new GetLibrarySectionsAllQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetLibrarySectionsAllQueryParamType TvShow = new GetLibrarySectionsAllQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetLibrarySectionsAllQueryParamType Season = new GetLibrarySectionsAllQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetLibrarySectionsAllQueryParamType Episode = new GetLibrarySectionsAllQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetLibrarySectionsAllQueryParamType Artist = new GetLibrarySectionsAllQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetLibrarySectionsAllQueryParamType Album = new GetLibrarySectionsAllQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetLibrarySectionsAllQueryParamType Track = new GetLibrarySectionsAllQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetLibrarySectionsAllQueryParamType PhotoAlbum = new GetLibrarySectionsAllQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetLibrarySectionsAllRequest
|
public class GetLibrarySectionsAllRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetMediaMetaDataImage
|
public class GetMediaMetaDataImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetMediaMetaDataLibraryType
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("coverPoster")]
|
|
||||||
CoverPoster,
|
|
||||||
[JsonProperty("background")]
|
|
||||||
Background,
|
|
||||||
[JsonProperty("snapshot")]
|
|
||||||
Snapshot,
|
|
||||||
[JsonProperty("clearLogo")]
|
|
||||||
ClearLogo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetMediaMetaDataLibraryTypeExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetMediaMetaDataLibraryType : IEquatable<GetMediaMetaDataLibraryType>
|
||||||
{
|
{
|
||||||
public static string Value(this GetMediaMetaDataLibraryType value)
|
public static readonly GetMediaMetaDataLibraryType CoverPoster = new GetMediaMetaDataLibraryType("coverPoster");
|
||||||
{
|
public static readonly GetMediaMetaDataLibraryType Background = new GetMediaMetaDataLibraryType("background");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
public static readonly GetMediaMetaDataLibraryType Snapshot = new GetMediaMetaDataLibraryType("snapshot");
|
||||||
}
|
public static readonly GetMediaMetaDataLibraryType ClearLogo = new GetMediaMetaDataLibraryType("clearLogo");
|
||||||
|
|
||||||
public static GetMediaMetaDataLibraryType ToEnum(this string value)
|
private static readonly Dictionary <string, GetMediaMetaDataLibraryType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetMediaMetaDataLibraryType> ()
|
||||||
foreach(var field in typeof(GetMediaMetaDataLibraryType).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["coverPoster"] = CoverPoster,
|
||||||
if (attributes.Length == 0)
|
["background"] = Background,
|
||||||
{
|
["snapshot"] = Snapshot,
|
||||||
continue;
|
["clearLogo"] = ClearLogo
|
||||||
}
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetMediaMetaDataLibraryType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetMediaMetaDataLibraryType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetMediaMetaDataLibraryType)
|
private GetMediaMetaDataLibraryType(string value)
|
||||||
{
|
{
|
||||||
return (GetMediaMetaDataLibraryType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataLibraryType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown<br/>
|
/// Unknown<br/>
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetMediaMetaDataType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetMediaMetaDataType : IEquatable<GetMediaMetaDataType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetMediaMetaDataType Movie = new GetMediaMetaDataType("movie");
|
||||||
Movie,
|
public static readonly GetMediaMetaDataType TvShow = new GetMediaMetaDataType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetMediaMetaDataType Season = new GetMediaMetaDataType("season");
|
||||||
TvShow,
|
public static readonly GetMediaMetaDataType Episode = new GetMediaMetaDataType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetMediaMetaDataType Artist = new GetMediaMetaDataType("artist");
|
||||||
Season,
|
public static readonly GetMediaMetaDataType Album = new GetMediaMetaDataType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetMediaMetaDataType Track = new GetMediaMetaDataType("track");
|
||||||
Episode,
|
public static readonly GetMediaMetaDataType PhotoAlbum = new GetMediaMetaDataType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetMediaMetaDataType Photo = new GetMediaMetaDataType("photo");
|
||||||
Artist,
|
public static readonly GetMediaMetaDataType Collection = new GetMediaMetaDataType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetMediaMetaDataTypeExtension
|
private static readonly Dictionary <string, GetMediaMetaDataType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetMediaMetaDataType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetMediaMetaDataType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetMediaMetaDataType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetMediaMetaDataType)
|
private GetMediaMetaDataType(string value)
|
||||||
{
|
{
|
||||||
return (GetMediaMetaDataType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetPlaylistContentsQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetPlaylistContentsQueryParamType : IEquatable<GetPlaylistContentsQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetPlaylistContentsQueryParamType Movie = new GetPlaylistContentsQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetPlaylistContentsQueryParamType TvShow = new GetPlaylistContentsQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetPlaylistContentsQueryParamType Season = new GetPlaylistContentsQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetPlaylistContentsQueryParamType Episode = new GetPlaylistContentsQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetPlaylistContentsQueryParamType Artist = new GetPlaylistContentsQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetPlaylistContentsQueryParamType Album = new GetPlaylistContentsQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetPlaylistContentsQueryParamType Track = new GetPlaylistContentsQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetPlaylistContentsQueryParamType PhotoAlbum = new GetPlaylistContentsQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetPlaylistContentsRequest
|
public class GetPlaylistContentsRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetPlaylistsRequest
|
public class GetPlaylistsRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetRecentlyAddedHubsResponseType
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("coverPoster")]
|
|
||||||
CoverPoster,
|
|
||||||
[JsonProperty("background")]
|
|
||||||
Background,
|
|
||||||
[JsonProperty("snapshot")]
|
|
||||||
Snapshot,
|
|
||||||
[JsonProperty("clearLogo")]
|
|
||||||
ClearLogo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetRecentlyAddedHubsResponseTypeExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetRecentlyAddedHubsResponseType : IEquatable<GetRecentlyAddedHubsResponseType>
|
||||||
{
|
{
|
||||||
public static string Value(this GetRecentlyAddedHubsResponseType value)
|
public static readonly GetRecentlyAddedHubsResponseType CoverPoster = new GetRecentlyAddedHubsResponseType("coverPoster");
|
||||||
{
|
public static readonly GetRecentlyAddedHubsResponseType Background = new GetRecentlyAddedHubsResponseType("background");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
public static readonly GetRecentlyAddedHubsResponseType Snapshot = new GetRecentlyAddedHubsResponseType("snapshot");
|
||||||
}
|
public static readonly GetRecentlyAddedHubsResponseType ClearLogo = new GetRecentlyAddedHubsResponseType("clearLogo");
|
||||||
|
|
||||||
public static GetRecentlyAddedHubsResponseType ToEnum(this string value)
|
private static readonly Dictionary <string, GetRecentlyAddedHubsResponseType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetRecentlyAddedHubsResponseType> ()
|
||||||
foreach(var field in typeof(GetRecentlyAddedHubsResponseType).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["coverPoster"] = CoverPoster,
|
||||||
if (attributes.Length == 0)
|
["background"] = Background,
|
||||||
{
|
["snapshot"] = Snapshot,
|
||||||
continue;
|
["clearLogo"] = ClearLogo
|
||||||
}
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetRecentlyAddedHubsResponseType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetRecentlyAddedHubsResponseType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetRecentlyAddedHubsResponseType)
|
private GetRecentlyAddedHubsResponseType(string value)
|
||||||
{
|
{
|
||||||
return (GetRecentlyAddedHubsResponseType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsResponseType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetRecentlyAddedHubsType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetRecentlyAddedHubsType : IEquatable<GetRecentlyAddedHubsType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetRecentlyAddedHubsType Movie = new GetRecentlyAddedHubsType("movie");
|
||||||
Movie,
|
public static readonly GetRecentlyAddedHubsType TvShow = new GetRecentlyAddedHubsType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetRecentlyAddedHubsType Season = new GetRecentlyAddedHubsType("season");
|
||||||
TvShow,
|
public static readonly GetRecentlyAddedHubsType Episode = new GetRecentlyAddedHubsType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetRecentlyAddedHubsType Artist = new GetRecentlyAddedHubsType("artist");
|
||||||
Season,
|
public static readonly GetRecentlyAddedHubsType Album = new GetRecentlyAddedHubsType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetRecentlyAddedHubsType Track = new GetRecentlyAddedHubsType("track");
|
||||||
Episode,
|
public static readonly GetRecentlyAddedHubsType PhotoAlbum = new GetRecentlyAddedHubsType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetRecentlyAddedHubsType Photo = new GetRecentlyAddedHubsType("photo");
|
||||||
Artist,
|
public static readonly GetRecentlyAddedHubsType Collection = new GetRecentlyAddedHubsType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetRecentlyAddedHubsTypeExtension
|
private static readonly Dictionary <string, GetRecentlyAddedHubsType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetRecentlyAddedHubsType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetRecentlyAddedHubsType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetRecentlyAddedHubsType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetRecentlyAddedHubsType)
|
private GetRecentlyAddedHubsType(string value)
|
||||||
{
|
{
|
||||||
return (GetRecentlyAddedHubsType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetRecentlyAddedImage
|
public class GetRecentlyAddedImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetRecentlyAddedLibraryRequest
|
public class GetRecentlyAddedLibraryRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown<br/>
|
/// Unknown<br/>
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetRecentlyAddedRequest
|
public class GetRecentlyAddedRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetSearchAllLibrariesFlattenSeasons
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetSearchAllLibrariesFlattenSeasons : IEquatable<GetSearchAllLibrariesFlattenSeasons>
|
||||||
{
|
{
|
||||||
[JsonProperty("-1")]
|
public static readonly GetSearchAllLibrariesFlattenSeasons LibraryDefault = new GetSearchAllLibrariesFlattenSeasons("-1");
|
||||||
LibraryDefault,
|
public static readonly GetSearchAllLibrariesFlattenSeasons Hide = new GetSearchAllLibrariesFlattenSeasons("0");
|
||||||
[JsonProperty("0")]
|
public static readonly GetSearchAllLibrariesFlattenSeasons Show = new GetSearchAllLibrariesFlattenSeasons("1");
|
||||||
Hide,
|
|
||||||
[JsonProperty("1")]
|
|
||||||
Show,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetSearchAllLibrariesFlattenSeasonsExtension
|
private static readonly Dictionary <string, GetSearchAllLibrariesFlattenSeasons> _knownValues =
|
||||||
{
|
new Dictionary <string, GetSearchAllLibrariesFlattenSeasons> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["-1"] = LibraryDefault,
|
||||||
if (attributes.Length == 0)
|
["0"] = Hide,
|
||||||
{
|
["1"] = Show
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesFlattenSeasons> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetSearchAllLibrariesFlattenSeasons>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetSearchAllLibrariesFlattenSeasons)
|
private GetSearchAllLibrariesFlattenSeasons(string value)
|
||||||
{
|
{
|
||||||
return (GetSearchAllLibrariesFlattenSeasons)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesFlattenSeasons");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetSearchAllLibrariesImage
|
public class GetSearchAllLibrariesImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetSearchAllLibrariesLibraryType
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("coverPoster")]
|
|
||||||
CoverPoster,
|
|
||||||
[JsonProperty("background")]
|
|
||||||
Background,
|
|
||||||
[JsonProperty("snapshot")]
|
|
||||||
Snapshot,
|
|
||||||
[JsonProperty("clearLogo")]
|
|
||||||
ClearLogo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetSearchAllLibrariesLibraryTypeExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetSearchAllLibrariesLibraryType : IEquatable<GetSearchAllLibrariesLibraryType>
|
||||||
{
|
{
|
||||||
public static string Value(this GetSearchAllLibrariesLibraryType value)
|
public static readonly GetSearchAllLibrariesLibraryType CoverPoster = new GetSearchAllLibrariesLibraryType("coverPoster");
|
||||||
{
|
public static readonly GetSearchAllLibrariesLibraryType Background = new GetSearchAllLibrariesLibraryType("background");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
public static readonly GetSearchAllLibrariesLibraryType Snapshot = new GetSearchAllLibrariesLibraryType("snapshot");
|
||||||
}
|
public static readonly GetSearchAllLibrariesLibraryType ClearLogo = new GetSearchAllLibrariesLibraryType("clearLogo");
|
||||||
|
|
||||||
public static GetSearchAllLibrariesLibraryType ToEnum(this string value)
|
private static readonly Dictionary <string, GetSearchAllLibrariesLibraryType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetSearchAllLibrariesLibraryType> ()
|
||||||
foreach(var field in typeof(GetSearchAllLibrariesLibraryType).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["coverPoster"] = CoverPoster,
|
||||||
if (attributes.Length == 0)
|
["background"] = Background,
|
||||||
{
|
["snapshot"] = Snapshot,
|
||||||
continue;
|
["clearLogo"] = ClearLogo
|
||||||
}
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesLibraryType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetSearchAllLibrariesLibraryType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetSearchAllLibrariesLibraryType)
|
private GetSearchAllLibrariesLibraryType(string value)
|
||||||
{
|
{
|
||||||
return (GetSearchAllLibrariesLibraryType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesLibraryType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown<br/>
|
/// Unknown<br/>
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetSearchAllLibrariesRequest
|
public class GetSearchAllLibrariesRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setting that indicates the episode ordering for the show.<br/>
|
/// Setting that indicates the episode ordering for the show.<br/>
|
||||||
///
|
///
|
||||||
@@ -26,51 +29,66 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetSearchAllLibrariesShowOrdering
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetSearchAllLibrariesShowOrdering : IEquatable<GetSearchAllLibrariesShowOrdering>
|
||||||
{
|
{
|
||||||
[JsonProperty("None")]
|
public static readonly GetSearchAllLibrariesShowOrdering None = new GetSearchAllLibrariesShowOrdering("None");
|
||||||
None,
|
public static readonly GetSearchAllLibrariesShowOrdering TmdbAiring = new GetSearchAllLibrariesShowOrdering("tmdbAiring");
|
||||||
[JsonProperty("tmdbAiring")]
|
public static readonly GetSearchAllLibrariesShowOrdering TvdbAired = new GetSearchAllLibrariesShowOrdering("aired");
|
||||||
TmdbAiring,
|
public static readonly GetSearchAllLibrariesShowOrdering TvdbDvd = new GetSearchAllLibrariesShowOrdering("dvd");
|
||||||
[JsonProperty("aired")]
|
public static readonly GetSearchAllLibrariesShowOrdering TvdbAbsolute = new GetSearchAllLibrariesShowOrdering("absolute");
|
||||||
TvdbAired,
|
|
||||||
[JsonProperty("dvd")]
|
|
||||||
TvdbDvd,
|
|
||||||
[JsonProperty("absolute")]
|
|
||||||
TvdbAbsolute,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetSearchAllLibrariesShowOrderingExtension
|
private static readonly Dictionary <string, GetSearchAllLibrariesShowOrdering> _knownValues =
|
||||||
{
|
new Dictionary <string, GetSearchAllLibrariesShowOrdering> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["None"] = None,
|
||||||
if (attributes.Length == 0)
|
["tmdbAiring"] = TmdbAiring,
|
||||||
{
|
["aired"] = TvdbAired,
|
||||||
continue;
|
["dvd"] = TvdbDvd,
|
||||||
}
|
["absolute"] = TvdbAbsolute
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesShowOrdering> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetSearchAllLibrariesShowOrdering>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetSearchAllLibrariesShowOrdering)
|
private GetSearchAllLibrariesShowOrdering(string value)
|
||||||
{
|
{
|
||||||
return (GetSearchAllLibrariesShowOrdering)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesShowOrdering");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
/// 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>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetSearchAllLibrariesType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetSearchAllLibrariesType : IEquatable<GetSearchAllLibrariesType>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly GetSearchAllLibrariesType Movie = new GetSearchAllLibrariesType("movie");
|
||||||
Movie,
|
public static readonly GetSearchAllLibrariesType TvShow = new GetSearchAllLibrariesType("show");
|
||||||
[JsonProperty("show")]
|
public static readonly GetSearchAllLibrariesType Season = new GetSearchAllLibrariesType("season");
|
||||||
TvShow,
|
public static readonly GetSearchAllLibrariesType Episode = new GetSearchAllLibrariesType("episode");
|
||||||
[JsonProperty("season")]
|
public static readonly GetSearchAllLibrariesType Artist = new GetSearchAllLibrariesType("artist");
|
||||||
Season,
|
public static readonly GetSearchAllLibrariesType Album = new GetSearchAllLibrariesType("album");
|
||||||
[JsonProperty("episode")]
|
public static readonly GetSearchAllLibrariesType Track = new GetSearchAllLibrariesType("track");
|
||||||
Episode,
|
public static readonly GetSearchAllLibrariesType PhotoAlbum = new GetSearchAllLibrariesType("photoalbum");
|
||||||
[JsonProperty("artist")]
|
public static readonly GetSearchAllLibrariesType Photo = new GetSearchAllLibrariesType("photo");
|
||||||
Artist,
|
public static readonly GetSearchAllLibrariesType Collection = new GetSearchAllLibrariesType("collection");
|
||||||
[JsonProperty("album")]
|
|
||||||
Album,
|
|
||||||
[JsonProperty("track")]
|
|
||||||
Track,
|
|
||||||
[JsonProperty("photoalbum")]
|
|
||||||
PhotoAlbum,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
[JsonProperty("collection")]
|
|
||||||
Collection,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetSearchAllLibrariesTypeExtension
|
private static readonly Dictionary <string, GetSearchAllLibrariesType> _knownValues =
|
||||||
{
|
new Dictionary <string, GetSearchAllLibrariesType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = TvShow,
|
||||||
{
|
["season"] = Season,
|
||||||
continue;
|
["episode"] = Episode,
|
||||||
}
|
["artist"] = Artist,
|
||||||
|
["album"] = Album,
|
||||||
|
["track"] = Track,
|
||||||
|
["photoalbum"] = PhotoAlbum,
|
||||||
|
["photo"] = Photo,
|
||||||
|
["collection"] = Collection
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetSearchAllLibrariesType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetSearchAllLibrariesType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetSearchAllLibrariesType)
|
private GetSearchAllLibrariesType(string value)
|
||||||
{
|
{
|
||||||
return (GetSearchAllLibrariesType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetSearchLibraryQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetSearchLibraryQueryParamType : IEquatable<GetSearchLibraryQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetSearchLibraryQueryParamType Movie = new GetSearchLibraryQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetSearchLibraryQueryParamType TvShow = new GetSearchLibraryQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetSearchLibraryQueryParamType Season = new GetSearchLibraryQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetSearchLibraryQueryParamType Episode = new GetSearchLibraryQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetSearchLibraryQueryParamType Artist = new GetSearchLibraryQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetSearchLibraryQueryParamType Album = new GetSearchLibraryQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetSearchLibraryQueryParamType Track = new GetSearchLibraryQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetSearchLibraryQueryParamType PhotoAlbum = new GetSearchLibraryQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetSearchLibraryRequest
|
public class GetSearchLibraryRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetTimelineRequest
|
public class GetTimelineRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String representation of subscriptionActive
|
/// String representation of subscriptionActive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetTokenDetailsAuthenticationResponseStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetTokenDetailsAuthenticationResponseStatus : IEquatable<GetTokenDetailsAuthenticationResponseStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("Inactive")]
|
public static readonly GetTokenDetailsAuthenticationResponseStatus Inactive = new GetTokenDetailsAuthenticationResponseStatus("Inactive");
|
||||||
Inactive,
|
public static readonly GetTokenDetailsAuthenticationResponseStatus Active = new GetTokenDetailsAuthenticationResponseStatus("Active");
|
||||||
[JsonProperty("Active")]
|
|
||||||
Active,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetTokenDetailsAuthenticationResponseStatusExtension
|
private static readonly Dictionary <string, GetTokenDetailsAuthenticationResponseStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, GetTokenDetailsAuthenticationResponseStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["Inactive"] = Inactive,
|
||||||
if (attributes.Length == 0)
|
["Active"] = Active
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetTokenDetailsAuthenticationResponseStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetTokenDetailsAuthenticationResponseStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetTokenDetailsAuthenticationResponseStatus)
|
private GetTokenDetailsAuthenticationResponseStatus(string value)
|
||||||
{
|
{
|
||||||
return (GetTokenDetailsAuthenticationResponseStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetTokenDetailsAuthenticationResponseStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String representation of subscriptionActive
|
/// String representation of subscriptionActive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetTokenDetailsAuthenticationStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetTokenDetailsAuthenticationStatus : IEquatable<GetTokenDetailsAuthenticationStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("Inactive")]
|
public static readonly GetTokenDetailsAuthenticationStatus Inactive = new GetTokenDetailsAuthenticationStatus("Inactive");
|
||||||
Inactive,
|
public static readonly GetTokenDetailsAuthenticationStatus Active = new GetTokenDetailsAuthenticationStatus("Active");
|
||||||
[JsonProperty("Active")]
|
|
||||||
Active,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetTokenDetailsAuthenticationStatusExtension
|
private static readonly Dictionary <string, GetTokenDetailsAuthenticationStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, GetTokenDetailsAuthenticationStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["Inactive"] = Inactive,
|
||||||
if (attributes.Length == 0)
|
["Active"] = Active
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetTokenDetailsAuthenticationStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetTokenDetailsAuthenticationStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetTokenDetailsAuthenticationStatus)
|
private GetTokenDetailsAuthenticationStatus(string value)
|
||||||
{
|
{
|
||||||
return (GetTokenDetailsAuthenticationStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetTokenDetailsAuthenticationStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,46 +12,64 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum GetTokenDetailsStatus
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("online")]
|
|
||||||
Online,
|
|
||||||
[JsonProperty("offline")]
|
|
||||||
Offline,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class GetTokenDetailsStatusExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetTokenDetailsStatus : IEquatable<GetTokenDetailsStatus>
|
||||||
{
|
{
|
||||||
public static string Value(this GetTokenDetailsStatus value)
|
public static readonly GetTokenDetailsStatus Online = new GetTokenDetailsStatus("online");
|
||||||
{
|
public static readonly GetTokenDetailsStatus Offline = new GetTokenDetailsStatus("offline");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GetTokenDetailsStatus ToEnum(this string value)
|
private static readonly Dictionary <string, GetTokenDetailsStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, GetTokenDetailsStatus> ()
|
||||||
foreach(var field in typeof(GetTokenDetailsStatus).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["online"] = Online,
|
||||||
if (attributes.Length == 0)
|
["offline"] = Offline
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, GetTokenDetailsStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, GetTokenDetailsStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is GetTokenDetailsStatus)
|
private GetTokenDetailsStatus(string value)
|
||||||
{
|
{
|
||||||
return (GetTokenDetailsStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum GetTokenDetailsStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetTokenDetailsSubscription
|
public class GetTokenDetailsSubscription
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logged in user details
|
/// Logged in user details
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GetTopWatchedContentQueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class GetTopWatchedContentQueryParamType : IEquatable<GetTopWatchedContentQueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly GetTopWatchedContentQueryParamType Movie = new GetTopWatchedContentQueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly GetTopWatchedContentQueryParamType TvShow = new GetTopWatchedContentQueryParamType(2);
|
||||||
Season = 3,
|
public static readonly GetTopWatchedContentQueryParamType Season = new GetTopWatchedContentQueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly GetTopWatchedContentQueryParamType Episode = new GetTopWatchedContentQueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly GetTopWatchedContentQueryParamType Artist = new GetTopWatchedContentQueryParamType(5);
|
||||||
Album = 6,
|
public static readonly GetTopWatchedContentQueryParamType Album = new GetTopWatchedContentQueryParamType(6);
|
||||||
Track = 7,
|
public static readonly GetTopWatchedContentQueryParamType Track = new GetTopWatchedContentQueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly GetTopWatchedContentQueryParamType PhotoAlbum = new GetTopWatchedContentQueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetTopWatchedContentRequest
|
public class GetTopWatchedContentRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class GetWatchListRequest
|
public class GetWatchListRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An integer log level to write to the PMS log with.<br/>
|
/// An integer log level to write to the PMS log with.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,13 +28,65 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Level
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Level : IEquatable<Level>
|
||||||
{
|
{
|
||||||
Zero = 0,
|
public static readonly Level Zero = new Level(0);
|
||||||
One = 1,
|
public static readonly Level One = new Level(1);
|
||||||
Two = 2,
|
public static readonly Level Two = new Level(2);
|
||||||
Three = 3,
|
public static readonly Level Three = new Level(3);
|
||||||
Four = 4,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of library to filter. Can be "movie" or "show", or all if not present.<br/>
|
/// The type of library to filter. Can be "movie" or "show", or all if not present.<br/>
|
||||||
///
|
///
|
||||||
@@ -20,45 +23,60 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Libtype
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Libtype : IEquatable<Libtype>
|
||||||
{
|
{
|
||||||
[JsonProperty("movie")]
|
public static readonly Libtype Movie = new Libtype("movie");
|
||||||
Movie,
|
public static readonly Libtype Show = new Libtype("show");
|
||||||
[JsonProperty("show")]
|
|
||||||
Show,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class LibtypeExtension
|
private static readonly Dictionary <string, Libtype> _knownValues =
|
||||||
{
|
new Dictionary <string, Libtype> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movie"] = Movie,
|
||||||
if (attributes.Length == 0)
|
["show"] = Show
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, Libtype> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, Libtype>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is Libtype)
|
private Libtype(string value)
|
||||||
{
|
{
|
||||||
return (Libtype)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum Libtype");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class LogLineRequest
|
public class LogLineRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Your current mailing list status (active or unsubscribed)
|
/// Your current mailing list status (active or unsubscribed)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum MailingListStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class MailingListStatus : IEquatable<MailingListStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("active")]
|
public static readonly MailingListStatus Active = new MailingListStatus("active");
|
||||||
Active,
|
public static readonly MailingListStatus Unsubscribed = new MailingListStatus("unsubscribed");
|
||||||
[JsonProperty("unsubscribed")]
|
|
||||||
Unsubscribed,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class MailingListStatusExtension
|
private static readonly Dictionary <string, MailingListStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, MailingListStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["active"] = Active,
|
||||||
if (attributes.Length == 0)
|
["unsubscribed"] = Unsubscribed
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, MailingListStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, MailingListStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is MailingListStatus)
|
private MailingListStatus(string value)
|
||||||
{
|
{
|
||||||
return (MailingListStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum MailingListStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class PastSubscription
|
public class PastSubscription
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,73 +12,91 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the task to be started.
|
/// The name of the task to be started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PathParamTaskName
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PathParamTaskName : IEquatable<PathParamTaskName>
|
||||||
{
|
{
|
||||||
[JsonProperty("BackupDatabase")]
|
public static readonly PathParamTaskName BackupDatabase = new PathParamTaskName("BackupDatabase");
|
||||||
BackupDatabase,
|
public static readonly PathParamTaskName BuildGracenoteCollections = new PathParamTaskName("BuildGracenoteCollections");
|
||||||
[JsonProperty("BuildGracenoteCollections")]
|
public static readonly PathParamTaskName CheckForUpdates = new PathParamTaskName("CheckForUpdates");
|
||||||
BuildGracenoteCollections,
|
public static readonly PathParamTaskName CleanOldBundles = new PathParamTaskName("CleanOldBundles");
|
||||||
[JsonProperty("CheckForUpdates")]
|
public static readonly PathParamTaskName CleanOldCacheFiles = new PathParamTaskName("CleanOldCacheFiles");
|
||||||
CheckForUpdates,
|
public static readonly PathParamTaskName DeepMediaAnalysis = new PathParamTaskName("DeepMediaAnalysis");
|
||||||
[JsonProperty("CleanOldBundles")]
|
public static readonly PathParamTaskName GenerateAutoTags = new PathParamTaskName("GenerateAutoTags");
|
||||||
CleanOldBundles,
|
public static readonly PathParamTaskName GenerateChapterThumbs = new PathParamTaskName("GenerateChapterThumbs");
|
||||||
[JsonProperty("CleanOldCacheFiles")]
|
public static readonly PathParamTaskName GenerateMediaIndexFiles = new PathParamTaskName("GenerateMediaIndexFiles");
|
||||||
CleanOldCacheFiles,
|
public static readonly PathParamTaskName OptimizeDatabase = new PathParamTaskName("OptimizeDatabase");
|
||||||
[JsonProperty("DeepMediaAnalysis")]
|
public static readonly PathParamTaskName RefreshLibraries = new PathParamTaskName("RefreshLibraries");
|
||||||
DeepMediaAnalysis,
|
public static readonly PathParamTaskName RefreshLocalMedia = new PathParamTaskName("RefreshLocalMedia");
|
||||||
[JsonProperty("GenerateAutoTags")]
|
public static readonly PathParamTaskName RefreshPeriodicMetadata = new PathParamTaskName("RefreshPeriodicMetadata");
|
||||||
GenerateAutoTags,
|
public static readonly PathParamTaskName UpgradeMediaAnalysis = new PathParamTaskName("UpgradeMediaAnalysis");
|
||||||
[JsonProperty("GenerateChapterThumbs")]
|
|
||||||
GenerateChapterThumbs,
|
|
||||||
[JsonProperty("GenerateMediaIndexFiles")]
|
|
||||||
GenerateMediaIndexFiles,
|
|
||||||
[JsonProperty("OptimizeDatabase")]
|
|
||||||
OptimizeDatabase,
|
|
||||||
[JsonProperty("RefreshLibraries")]
|
|
||||||
RefreshLibraries,
|
|
||||||
[JsonProperty("RefreshLocalMedia")]
|
|
||||||
RefreshLocalMedia,
|
|
||||||
[JsonProperty("RefreshPeriodicMetadata")]
|
|
||||||
RefreshPeriodicMetadata,
|
|
||||||
[JsonProperty("UpgradeMediaAnalysis")]
|
|
||||||
UpgradeMediaAnalysis,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PathParamTaskNameExtension
|
private static readonly Dictionary <string, PathParamTaskName> _knownValues =
|
||||||
{
|
new Dictionary <string, PathParamTaskName> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["BackupDatabase"] = BackupDatabase,
|
||||||
if (attributes.Length == 0)
|
["BuildGracenoteCollections"] = BuildGracenoteCollections,
|
||||||
{
|
["CheckForUpdates"] = CheckForUpdates,
|
||||||
continue;
|
["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;
|
private static readonly ConcurrentDictionary<string, PathParamTaskName> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PathParamTaskName>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PathParamTaskName)
|
private PathParamTaskName(string value)
|
||||||
{
|
{
|
||||||
return (PathParamTaskName)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PathParamTaskName");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// limit to a type of playlist.
|
/// limit to a type of playlist.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PlaylistType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PlaylistType : IEquatable<PlaylistType>
|
||||||
{
|
{
|
||||||
[JsonProperty("audio")]
|
public static readonly PlaylistType Audio = new PlaylistType("audio");
|
||||||
Audio,
|
public static readonly PlaylistType Video = new PlaylistType("video");
|
||||||
[JsonProperty("video")]
|
public static readonly PlaylistType Photo = new PlaylistType("photo");
|
||||||
Video,
|
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PlaylistTypeExtension
|
private static readonly Dictionary <string, PlaylistType> _knownValues =
|
||||||
{
|
new Dictionary <string, PlaylistType> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["audio"] = Audio,
|
||||||
if (attributes.Length == 0)
|
["video"] = Video,
|
||||||
{
|
["photo"] = Photo
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PlaylistType> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PlaylistType>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PlaylistType)
|
private PlaylistType(string value)
|
||||||
{
|
{
|
||||||
return (PlaylistType)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PlaylistType");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String representation of subscriptionActive
|
/// String representation of subscriptionActive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PostUsersSignInDataAuthenticationResponseStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PostUsersSignInDataAuthenticationResponseStatus : IEquatable<PostUsersSignInDataAuthenticationResponseStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("Inactive")]
|
public static readonly PostUsersSignInDataAuthenticationResponseStatus Inactive = new PostUsersSignInDataAuthenticationResponseStatus("Inactive");
|
||||||
Inactive,
|
public static readonly PostUsersSignInDataAuthenticationResponseStatus Active = new PostUsersSignInDataAuthenticationResponseStatus("Active");
|
||||||
[JsonProperty("Active")]
|
|
||||||
Active,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PostUsersSignInDataAuthenticationResponseStatusExtension
|
private static readonly Dictionary <string, PostUsersSignInDataAuthenticationResponseStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, PostUsersSignInDataAuthenticationResponseStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["Inactive"] = Inactive,
|
||||||
if (attributes.Length == 0)
|
["Active"] = Active
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PostUsersSignInDataAuthenticationResponseStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PostUsersSignInDataAuthenticationResponseStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PostUsersSignInDataAuthenticationResponseStatus)
|
private PostUsersSignInDataAuthenticationResponseStatus(string value)
|
||||||
{
|
{
|
||||||
return (PostUsersSignInDataAuthenticationResponseStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationResponseStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String representation of subscriptionActive
|
/// String representation of subscriptionActive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PostUsersSignInDataAuthenticationStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PostUsersSignInDataAuthenticationStatus : IEquatable<PostUsersSignInDataAuthenticationStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("Inactive")]
|
public static readonly PostUsersSignInDataAuthenticationStatus Inactive = new PostUsersSignInDataAuthenticationStatus("Inactive");
|
||||||
Inactive,
|
public static readonly PostUsersSignInDataAuthenticationStatus Active = new PostUsersSignInDataAuthenticationStatus("Active");
|
||||||
[JsonProperty("Active")]
|
|
||||||
Active,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PostUsersSignInDataAuthenticationStatusExtension
|
private static readonly Dictionary <string, PostUsersSignInDataAuthenticationStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, PostUsersSignInDataAuthenticationStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["Inactive"] = Inactive,
|
||||||
if (attributes.Length == 0)
|
["Active"] = Active
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PostUsersSignInDataAuthenticationStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PostUsersSignInDataAuthenticationStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PostUsersSignInDataAuthenticationStatus)
|
private PostUsersSignInDataAuthenticationStatus(string value)
|
||||||
{
|
{
|
||||||
return (PostUsersSignInDataAuthenticationStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class PostUsersSignInDataAuthenticationSubscription
|
public class PostUsersSignInDataAuthenticationSubscription
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,49 +12,67 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Your current mailing list status (active or unsubscribed)
|
/// Your current mailing list status (active or unsubscribed)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PostUsersSignInDataMailingListStatus
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PostUsersSignInDataMailingListStatus : IEquatable<PostUsersSignInDataMailingListStatus>
|
||||||
{
|
{
|
||||||
[JsonProperty("active")]
|
public static readonly PostUsersSignInDataMailingListStatus Active = new PostUsersSignInDataMailingListStatus("active");
|
||||||
Active,
|
public static readonly PostUsersSignInDataMailingListStatus Unsubscribed = new PostUsersSignInDataMailingListStatus("unsubscribed");
|
||||||
[JsonProperty("unsubscribed")]
|
|
||||||
Unsubscribed,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PostUsersSignInDataMailingListStatusExtension
|
private static readonly Dictionary <string, PostUsersSignInDataMailingListStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, PostUsersSignInDataMailingListStatus> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["active"] = Active,
|
||||||
if (attributes.Length == 0)
|
["unsubscribed"] = Unsubscribed
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PostUsersSignInDataMailingListStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PostUsersSignInDataMailingListStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PostUsersSignInDataMailingListStatus)
|
private PostUsersSignInDataMailingListStatus(string value)
|
||||||
{
|
{
|
||||||
return (PostUsersSignInDataMailingListStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataMailingListStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class PostUsersSignInDataServices
|
public class PostUsersSignInDataServices
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,44 +12,62 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum PostUsersSignInDataState
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("ended")]
|
|
||||||
Ended,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PostUsersSignInDataStateExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PostUsersSignInDataState : IEquatable<PostUsersSignInDataState>
|
||||||
{
|
{
|
||||||
public static string Value(this PostUsersSignInDataState value)
|
public static readonly PostUsersSignInDataState Ended = new PostUsersSignInDataState("ended");
|
||||||
{
|
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PostUsersSignInDataState ToEnum(this string value)
|
private static readonly Dictionary <string, PostUsersSignInDataState> _knownValues =
|
||||||
{
|
new Dictionary <string, PostUsersSignInDataState> ()
|
||||||
foreach(var field in typeof(PostUsersSignInDataState).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["ended"] = Ended
|
||||||
if (attributes.Length == 0)
|
};
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PostUsersSignInDataState> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PostUsersSignInDataState>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PostUsersSignInDataState)
|
private PostUsersSignInDataState(string value)
|
||||||
{
|
{
|
||||||
return (PostUsersSignInDataState)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataState");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,46 +12,64 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum PostUsersSignInDataStatus
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("online")]
|
|
||||||
Online,
|
|
||||||
[JsonProperty("offline")]
|
|
||||||
Offline,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PostUsersSignInDataStatusExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class PostUsersSignInDataStatus : IEquatable<PostUsersSignInDataStatus>
|
||||||
{
|
{
|
||||||
public static string Value(this PostUsersSignInDataStatus value)
|
public static readonly PostUsersSignInDataStatus Online = new PostUsersSignInDataStatus("online");
|
||||||
{
|
public static readonly PostUsersSignInDataStatus Offline = new PostUsersSignInDataStatus("offline");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PostUsersSignInDataStatus ToEnum(this string value)
|
private static readonly Dictionary <string, PostUsersSignInDataStatus> _knownValues =
|
||||||
{
|
new Dictionary <string, PostUsersSignInDataStatus> ()
|
||||||
foreach(var field in typeof(PostUsersSignInDataStatus).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["online"] = Online,
|
||||||
if (attributes.Length == 0)
|
["offline"] = Offline
|
||||||
{
|
};
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, PostUsersSignInDataStatus> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, PostUsersSignInDataStatus>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is PostUsersSignInDataStatus)
|
private PostUsersSignInDataStatus(string value)
|
||||||
{
|
{
|
||||||
return (PostUsersSignInDataStatus)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataStatus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the account’s Plex Pass subscription is active
|
/// If the account’s Plex Pass subscription is active
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the user account data with a valid auth token
|
/// Returns the user account data with a valid auth token
|
||||||
|
|||||||
@@ -10,14 +10,68 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// type of playlists to return (default is all).
|
/// type of playlists to return (default is all).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum QueryParamSmart
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class QueryParamSmart : IEquatable<QueryParamSmart>
|
||||||
{
|
{
|
||||||
Zero = 0,
|
public static readonly QueryParamSmart Zero = new QueryParamSmart(0);
|
||||||
One = 1,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum QueryParamType
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class QueryParamType : IEquatable<QueryParamType>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly QueryParamType Movie = new QueryParamType(1);
|
||||||
TvShow = 2,
|
public static readonly QueryParamType TvShow = new QueryParamType(2);
|
||||||
Season = 3,
|
public static readonly QueryParamType Season = new QueryParamType(3);
|
||||||
Episode = 4,
|
public static readonly QueryParamType Episode = new QueryParamType(4);
|
||||||
Artist = 5,
|
public static readonly QueryParamType Artist = new QueryParamType(5);
|
||||||
Album = 6,
|
public static readonly QueryParamType Album = new QueryParamType(6);
|
||||||
Track = 7,
|
public static readonly QueryParamType Track = new QueryParamType(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly QueryParamType PhotoAlbum = new QueryParamType(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,52 +12,70 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
public enum SearchTypes
|
using System.Collections.Generic;
|
||||||
{
|
using System.Linq;
|
||||||
[JsonProperty("movies")]
|
|
||||||
Movies,
|
|
||||||
[JsonProperty("music")]
|
|
||||||
Music,
|
|
||||||
[JsonProperty("otherVideos")]
|
|
||||||
OtherVideos,
|
|
||||||
[JsonProperty("people")]
|
|
||||||
People,
|
|
||||||
[JsonProperty("tv")]
|
|
||||||
Tv,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SearchTypesExtension
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class SearchTypes : IEquatable<SearchTypes>
|
||||||
{
|
{
|
||||||
public static string Value(this SearchTypes value)
|
public static readonly SearchTypes Movies = new SearchTypes("movies");
|
||||||
{
|
public static readonly SearchTypes Music = new SearchTypes("music");
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
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)
|
private static readonly Dictionary <string, SearchTypes> _knownValues =
|
||||||
{
|
new Dictionary <string, SearchTypes> ()
|
||||||
foreach(var field in typeof(SearchTypes).GetFields())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["movies"] = Movies,
|
||||||
if (attributes.Length == 0)
|
["music"] = Music,
|
||||||
{
|
["otherVideos"] = OtherVideos,
|
||||||
continue;
|
["people"] = People,
|
||||||
}
|
["tv"] = Tv
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, SearchTypes> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, SearchTypes>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is SearchTypes)
|
private SearchTypes(string value)
|
||||||
{
|
{
|
||||||
return (SearchTypes)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum SearchTypes");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class Services
|
public class Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setting that indicates the episode ordering for the show.<br/>
|
/// Setting that indicates the episode ordering for the show.<br/>
|
||||||
///
|
///
|
||||||
@@ -26,51 +29,66 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum ShowOrdering
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class ShowOrdering : IEquatable<ShowOrdering>
|
||||||
{
|
{
|
||||||
[JsonProperty("None")]
|
public static readonly ShowOrdering None = new ShowOrdering("None");
|
||||||
None,
|
public static readonly ShowOrdering TmdbAiring = new ShowOrdering("tmdbAiring");
|
||||||
[JsonProperty("tmdbAiring")]
|
public static readonly ShowOrdering TvdbAired = new ShowOrdering("aired");
|
||||||
TmdbAiring,
|
public static readonly ShowOrdering TvdbDvd = new ShowOrdering("dvd");
|
||||||
[JsonProperty("aired")]
|
public static readonly ShowOrdering TvdbAbsolute = new ShowOrdering("absolute");
|
||||||
TvdbAired,
|
|
||||||
[JsonProperty("dvd")]
|
|
||||||
TvdbDvd,
|
|
||||||
[JsonProperty("absolute")]
|
|
||||||
TvdbAbsolute,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ShowOrderingExtension
|
private static readonly Dictionary <string, ShowOrdering> _knownValues =
|
||||||
{
|
new Dictionary <string, ShowOrdering> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["None"] = None,
|
||||||
if (attributes.Length == 0)
|
["tmdbAiring"] = TmdbAiring,
|
||||||
{
|
["aired"] = TvdbAired,
|
||||||
continue;
|
["dvd"] = TvdbDvd,
|
||||||
}
|
["absolute"] = TvdbAbsolute
|
||||||
|
};
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, ShowOrdering> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, ShowOrdering>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is ShowOrdering)
|
private ShowOrdering(string value)
|
||||||
{
|
{
|
||||||
return (ShowOrdering)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum ShowOrdering");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class StartTaskRequest
|
public class StartTaskRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The state of the media item
|
/// The state of the media item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum State
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class State : IEquatable<State>
|
||||||
{
|
{
|
||||||
[JsonProperty("playing")]
|
public static readonly State Playing = new State("playing");
|
||||||
Playing,
|
public static readonly State Paused = new State("paused");
|
||||||
[JsonProperty("paused")]
|
public static readonly State Stopped = new State("stopped");
|
||||||
Paused,
|
|
||||||
[JsonProperty("stopped")]
|
|
||||||
Stopped,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class StateExtension
|
private static readonly Dictionary <string, State> _knownValues =
|
||||||
{
|
new Dictionary <string, State> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["playing"] = Playing,
|
||||||
if (attributes.Length == 0)
|
["paused"] = Paused,
|
||||||
{
|
["stopped"] = Stopped
|
||||||
continue;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, State> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, State>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is State)
|
private State(string value)
|
||||||
{
|
{
|
||||||
return (State)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum State");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,47 +12,65 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current friend request status
|
/// Current friend request status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Status
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Status : IEquatable<Status>
|
||||||
{
|
{
|
||||||
[JsonProperty("accepted")]
|
public static readonly Status Accepted = new Status("accepted");
|
||||||
Accepted,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class StatusExtension
|
private static readonly Dictionary <string, Status> _knownValues =
|
||||||
{
|
new Dictionary <string, Status> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["accepted"] = Accepted
|
||||||
if (attributes.Length == 0)
|
};
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
private static readonly ConcurrentDictionary<string, Status> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, Status>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is Status)
|
private Status(string value)
|
||||||
{
|
{
|
||||||
return (Status)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum Status");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
public class StopTaskRequest
|
public class StopTaskRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the account’s Plex Pass subscription is active
|
/// If the account’s Plex Pass subscription is active
|
||||||
|
|||||||
@@ -12,77 +12,95 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A key representing a specific tag within the section.
|
/// A key representing a specific tag within the section.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Tag
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Tag : IEquatable<Tag>
|
||||||
{
|
{
|
||||||
[JsonProperty("unwatched")]
|
public static readonly Tag Unwatched = new Tag("unwatched");
|
||||||
Unwatched,
|
public static readonly Tag Newest = new Tag("newest");
|
||||||
[JsonProperty("newest")]
|
public static readonly Tag RecentlyAdded = new Tag("recentlyAdded");
|
||||||
Newest,
|
public static readonly Tag RecentlyViewed = new Tag("recentlyViewed");
|
||||||
[JsonProperty("recentlyAdded")]
|
public static readonly Tag OnDeck = new Tag("onDeck");
|
||||||
RecentlyAdded,
|
public static readonly Tag Collection = new Tag("collection");
|
||||||
[JsonProperty("recentlyViewed")]
|
public static readonly Tag Edition = new Tag("edition");
|
||||||
RecentlyViewed,
|
public static readonly Tag Year = new Tag("year");
|
||||||
[JsonProperty("onDeck")]
|
public static readonly Tag Decade = new Tag("decade");
|
||||||
OnDeck,
|
public static readonly Tag Director = new Tag("director");
|
||||||
[JsonProperty("collection")]
|
public static readonly Tag ContentRating = new Tag("contentRating");
|
||||||
Collection,
|
public static readonly Tag Rating = new Tag("rating");
|
||||||
[JsonProperty("edition")]
|
public static readonly Tag Resolution = new Tag("resolution");
|
||||||
Edition,
|
public static readonly Tag FirstCharacter = new Tag("firstCharacter");
|
||||||
[JsonProperty("year")]
|
public static readonly Tag Folder = new Tag("folder");
|
||||||
Year,
|
public static readonly Tag Albums = new Tag("albums");
|
||||||
[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 class TagExtension
|
private static readonly Dictionary <string, Tag> _knownValues =
|
||||||
{
|
new Dictionary <string, Tag> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["unwatched"] = Unwatched,
|
||||||
if (attributes.Length == 0)
|
["newest"] = Newest,
|
||||||
{
|
["recentlyAdded"] = RecentlyAdded,
|
||||||
continue;
|
["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;
|
private static readonly ConcurrentDictionary<string, Tag> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, Tag>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is Tag)
|
private Tag(string value)
|
||||||
{
|
{
|
||||||
return (Tag)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum Tag");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,73 +12,91 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the name of the task to be started.
|
/// the name of the task to be started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum TaskName
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class TaskName : IEquatable<TaskName>
|
||||||
{
|
{
|
||||||
[JsonProperty("BackupDatabase")]
|
public static readonly TaskName BackupDatabase = new TaskName("BackupDatabase");
|
||||||
BackupDatabase,
|
public static readonly TaskName BuildGracenoteCollections = new TaskName("BuildGracenoteCollections");
|
||||||
[JsonProperty("BuildGracenoteCollections")]
|
public static readonly TaskName CheckForUpdates = new TaskName("CheckForUpdates");
|
||||||
BuildGracenoteCollections,
|
public static readonly TaskName CleanOldBundles = new TaskName("CleanOldBundles");
|
||||||
[JsonProperty("CheckForUpdates")]
|
public static readonly TaskName CleanOldCacheFiles = new TaskName("CleanOldCacheFiles");
|
||||||
CheckForUpdates,
|
public static readonly TaskName DeepMediaAnalysis = new TaskName("DeepMediaAnalysis");
|
||||||
[JsonProperty("CleanOldBundles")]
|
public static readonly TaskName GenerateAutoTags = new TaskName("GenerateAutoTags");
|
||||||
CleanOldBundles,
|
public static readonly TaskName GenerateChapterThumbs = new TaskName("GenerateChapterThumbs");
|
||||||
[JsonProperty("CleanOldCacheFiles")]
|
public static readonly TaskName GenerateMediaIndexFiles = new TaskName("GenerateMediaIndexFiles");
|
||||||
CleanOldCacheFiles,
|
public static readonly TaskName OptimizeDatabase = new TaskName("OptimizeDatabase");
|
||||||
[JsonProperty("DeepMediaAnalysis")]
|
public static readonly TaskName RefreshLibraries = new TaskName("RefreshLibraries");
|
||||||
DeepMediaAnalysis,
|
public static readonly TaskName RefreshLocalMedia = new TaskName("RefreshLocalMedia");
|
||||||
[JsonProperty("GenerateAutoTags")]
|
public static readonly TaskName RefreshPeriodicMetadata = new TaskName("RefreshPeriodicMetadata");
|
||||||
GenerateAutoTags,
|
public static readonly TaskName UpgradeMediaAnalysis = new TaskName("UpgradeMediaAnalysis");
|
||||||
[JsonProperty("GenerateChapterThumbs")]
|
|
||||||
GenerateChapterThumbs,
|
|
||||||
[JsonProperty("GenerateMediaIndexFiles")]
|
|
||||||
GenerateMediaIndexFiles,
|
|
||||||
[JsonProperty("OptimizeDatabase")]
|
|
||||||
OptimizeDatabase,
|
|
||||||
[JsonProperty("RefreshLibraries")]
|
|
||||||
RefreshLibraries,
|
|
||||||
[JsonProperty("RefreshLocalMedia")]
|
|
||||||
RefreshLocalMedia,
|
|
||||||
[JsonProperty("RefreshPeriodicMetadata")]
|
|
||||||
RefreshPeriodicMetadata,
|
|
||||||
[JsonProperty("UpgradeMediaAnalysis")]
|
|
||||||
UpgradeMediaAnalysis,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TaskNameExtension
|
private static readonly Dictionary <string, TaskName> _knownValues =
|
||||||
{
|
new Dictionary <string, TaskName> ()
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
["BackupDatabase"] = BackupDatabase,
|
||||||
if (attributes.Length == 0)
|
["BuildGracenoteCollections"] = BuildGracenoteCollections,
|
||||||
{
|
["CheckForUpdates"] = CheckForUpdates,
|
||||||
continue;
|
["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;
|
private static readonly ConcurrentDictionary<string, TaskName> _values =
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
new ConcurrentDictionary<string, TaskName>(_knownValues);
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is TaskName)
|
private TaskName(string value)
|
||||||
{
|
{
|
||||||
return (TaskName)enumVal;
|
if (value == null) throw new ArgumentNullException(nameof(value));
|
||||||
}
|
Value = value;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum TaskName");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,12 @@
|
|||||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||||
{
|
{
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of media to retrieve or filter by.<br/>
|
/// The type of media to retrieve or filter by.<br/>
|
||||||
///
|
///
|
||||||
@@ -23,17 +28,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Type
|
[JsonConverter(typeof(OpenEnumConverter))]
|
||||||
|
public class Type : IEquatable<Type>
|
||||||
{
|
{
|
||||||
Movie = 1,
|
public static readonly Type Movie = new Type(1);
|
||||||
TvShow = 2,
|
public static readonly Type TvShow = new Type(2);
|
||||||
Season = 3,
|
public static readonly Type Season = new Type(3);
|
||||||
Episode = 4,
|
public static readonly Type Episode = new Type(4);
|
||||||
Artist = 5,
|
public static readonly Type Artist = new Type(5);
|
||||||
Album = 6,
|
public static readonly Type Album = new Type(6);
|
||||||
Track = 7,
|
public static readonly Type Track = new Type(7);
|
||||||
PhotoAlbum = 8,
|
public static readonly Type PhotoAlbum = new Type(8);
|
||||||
Photo = 9,
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -146,8 +148,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Playlists(SDKConfig config)
|
public Playlists(SDKConfig config)
|
||||||
|
|||||||
@@ -143,8 +143,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
};
|
};
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
|
||||||
public Plex(SDKConfig config)
|
public Plex(SDKConfig config)
|
||||||
|
|||||||
@@ -292,8 +292,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
|
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.15.1";
|
private const string _sdkVersion = "0.16.0";
|
||||||
private const string _sdkGenVersion = "2.623.0";
|
private const string _sdkGenVersion = "2.674.1";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
public IServer Server { get; private set; }
|
public IServer Server { get; private set; }
|
||||||
public IMedia Media { get; private set; }
|
public IMedia Media { get; private set; }
|
||||||
@@ -353,7 +353,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
Users = new Users(SDKConfiguration);
|
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)
|
if (serverIndex != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{"port", "32400"},
|
{"port", "32400"},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
UserAgent = "speakeasy-sdk/csharp 0.15.1 2.623.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
UserAgent = "speakeasy-sdk/csharp 0.16.0 2.674.1 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
SecuritySource = null;
|
SecuritySource = null;
|
||||||
Hooks = new SDKHooks();
|
Hooks = new SDKHooks();
|
||||||
RetryConfig = null;
|
RetryConfig = null;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user