From 57825c432e0e33593cbc87182c9e14aabbdc013c Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 25 Sep 2024 16:23:01 +0000 Subject: [PATCH] ci: regenerated with Speakeasy CLI v1.402.14 --- .speakeasy/workflow.lock | 20 +- openapi-with-code-samples.yaml | 9344 +++++++++++++++++++++----------- 2 files changed, 6274 insertions(+), 3090 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ebdda47..7e2247b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.402.12 +speakeasyVersion: 1.402.14 sources: merge-code-samples-into-spec: sourceNamespace: merge-code-samples-into-spec - sourceRevisionDigest: sha256:8559be5fdfcd467d31f5360838fdef8436916858d5187caf9d112523d6493ade - sourceBlobDigest: sha256:2c2b2da4a193c98754ed782dd418ff1c6e7b01f708d9e78083f283418a44c145 + sourceRevisionDigest: sha256:152775604ae1abdda1426eab3c46f36d4ed6393898531b901a0ee6c535ae3ac6 + sourceBlobDigest: sha256:57a64aef5317a4620d6d429a780bda8884f3c457829920d1249d744ab8840a78 tags: - latest - main @@ -14,15 +14,15 @@ workflow: sources: merge-code-samples-into-spec: inputs: - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main overlays: - location: ./mintlify-overlay.yaml - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-php-plexphp:main - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-ruby-plexruby:main - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-go-plexgo:main - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-java-plexjava:main - - location: registry.speakeasyapi.dev/lukehagar/lukehagar/code-samples-typescript-plexjs:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-php-plexphp:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-ruby-plexruby:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-go-plexgo:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-java-plexjava:main + - location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-typescript-plexjs:main output: ./openapi-with-code-samples.yaml registry: - location: registry.speakeasyapi.dev/lukehagar/lukehagar/merge-code-samples-into-spec + location: registry.speakeasyapi.dev/plexapi/plexapi/merge-code-samples-into-spec targets: {} diff --git a/openapi-with-code-samples.yaml b/openapi-with-code-samples.yaml index 22f1fdd..dc9ee58 100644 --- a/openapi-with-code-samples.yaml +++ b/openapi-with-code-samples.yaml @@ -26,6 +26,7 @@ servers: x-speakeasy-globals: parameters: - name: X-Plex-Client-Identifier + x-speakeasy-name-override: ClientID description: | The unique identifier for the client application This is used to track the client application and its usage @@ -35,6 +36,34 @@ x-speakeasy-globals: type: string example: gcgzw5rz2xovp84b4vha3a40 required: true + - name: X-Plex-Product + x-speakeasy-name-override: ClientName + in: query + required: false + schema: + type: string + example: Plex Web + - name: X-Plex-Version + x-speakeasy-name-override: ClientVersion + in: query + required: false + schema: + type: string + example: 4.133.0 + - name: X-Plex-Platform + x-speakeasy-name-override: ClientPlatform + in: query + required: false + schema: + type: string + example: Chrome + - name: X-Plex-Device + x-speakeasy-name-override: DeviceName + in: query + required: false + schema: + type: string + example: Linux security: - accessToken: [] components: @@ -42,7 +71,7 @@ components: accessToken: description: Plex Authentication Token type: apiKey - in: query + in: header name: X-Plex-Token paths: /: @@ -189,6 +218,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -196,6 +226,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -212,6 +243,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -219,6 +251,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -231,11 +264,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -249,7 +287,7 @@ paths: } - lang: ruby label: getServerCapabilities - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_capabilities()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_capabilities()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getServerCapabilities source: |- @@ -264,7 +302,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -281,46 +323,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerCapabilitiesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetServerCapabilitiesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { - GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetServerCapabilitiesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -398,6 +425,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -405,6 +433,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -421,6 +450,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -428,6 +458,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -440,11 +471,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -458,7 +494,7 @@ paths: } - lang: ruby label: getServerPreferences - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_preferences()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_preferences()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getServerPreferences source: |- @@ -473,7 +509,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -490,46 +530,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerPreferencesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerPreferencesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetServerPreferencesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception { - GetServerPreferencesResponse res = sdk.server().getServerPreferences() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerPreferencesResponse res = sdk.server().getServerPreferences() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetServerPreferencesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -568,6 +593,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -575,6 +601,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -591,6 +618,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -598,6 +626,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -610,11 +639,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -629,7 +663,7 @@ paths: } - lang: ruby label: markPlayed - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_played(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_played(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: markPlayed source: |- @@ -644,7 +678,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -661,45 +699,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.MarkPlayedBadRequest; + import dev.plexapi.plexapi.models.errors.MarkPlayedUnauthorized; + import dev.plexapi.plexapi.models.operations.MarkPlayedResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception { - MarkPlayedResponse res = sdk.media().markPlayed() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + MarkPlayedResponse res = sdk.media().markPlayed() .key(59398d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.MarkPlayedResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -738,6 +761,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -745,6 +769,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -761,6 +786,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -768,6 +794,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -780,11 +807,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -799,7 +831,7 @@ paths: } - lang: ruby label: markUnplayed - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_unplayed(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.mark_unplayed(key=59398.0)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: markUnplayed source: |- @@ -814,7 +846,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -831,45 +867,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.MarkUnplayedBadRequest; + import dev.plexapi.plexapi.models.errors.MarkUnplayedUnauthorized; + import dev.plexapi.plexapi.models.operations.MarkUnplayedResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception { - MarkUnplayedResponse res = sdk.media().markUnplayed() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + MarkUnplayedResponse res = sdk.media().markUnplayed() .key(59398d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.MarkUnplayedResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -922,6 +943,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -929,6 +951,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -945,6 +968,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -952,6 +976,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -964,16 +989,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->media->updatePlayProgress('', 90000, 'played'); + $response = $sdk->media->updatePlayProgress('', 90000, 'played'); if ($response->statusCode === 200) { // handle response @@ -983,7 +1013,7 @@ paths: } - lang: ruby label: updatePlayProgress - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.update_play_progress(key=\"\", time=90000.0, state=\"played\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.media.update_play_progress(key=\"\", time=90000.0, state=\"played\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: updatePlayProgress source: |- @@ -998,7 +1028,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -1015,47 +1049,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.UpdatePlayProgressBadRequest; + import dev.plexapi.plexapi.models.errors.UpdatePlayProgressUnauthorized; + import dev.plexapi.plexapi.models.operations.UpdatePlayProgressResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception { - UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() - .key("") + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() + .key("") .time(90000d) .state("played") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlayProgressResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -1161,6 +1180,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -1168,6 +1188,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -1184,6 +1205,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -1191,6 +1213,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -1204,11 +1227,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -1234,7 +1262,7 @@ paths: } - lang: ruby label: getTimeline - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetTimelineRequest.new(\n rating_key: 23409.0,\n key: \"/library/metadata/23409\",\n state: ::PlexRubySDK::Operations::State::PLAYING,\n has_mde: 1.0,\n time: 2000.0,\n duration: 10000.0,\n context: \"home:hub.continueWatching\",\n play_queue_item_id: 1.0,\n play_back_time: 2000.0,\n row: 1.0,\n)\n \nres = s.video.get_timeline(req)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetTimelineRequest.new(\n rating_key: 23409.0,\n key: \"/library/metadata/23409\",\n state: ::PlexRubySDK::Operations::State::PLAYING,\n has_mde: 1.0,\n time: 2000.0,\n duration: 10000.0,\n context: \"home:hub.continueWatching\",\n play_queue_item_id: 1.0,\n play_back_time: 2000.0,\n row: 1.0,\n)\n \nres = s.video.get_timeline(req)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: getTimeline source: |- @@ -1250,7 +1278,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -1278,30 +1310,28 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTimelineBadRequest; + import dev.plexapi.plexapi.models.errors.GetTimelineUnauthorized; + import dev.plexapi.plexapi.models.operations.GetTimelineRequest; + import dev.plexapi.plexapi.models.operations.GetTimelineResponse; + import dev.plexapi.plexapi.models.operations.State; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception { - GetTimelineRequest req = GetTimelineRequest.builder() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTimelineRequest req = GetTimelineRequest.builder() .ratingKey(23409d) .key("/library/metadata/23409") .state(State.PLAYING) @@ -1314,22 +1344,11 @@ paths: .row(1d) .build(); - GetTimelineResponse res = sdk.video().getTimeline() + GetTimelineResponse res = sdk.video().getTimeline() .request(req) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.GetTimelineResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -1394,6 +1413,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -1401,6 +1421,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -1417,6 +1438,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -1424,6 +1446,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -1436,11 +1459,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -1454,7 +1482,7 @@ paths: } - lang: ruby label: getServerActivities - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.get_server_activities()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.get_server_activities()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getServerActivities source: |- @@ -1469,7 +1497,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -1486,46 +1518,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerActivitiesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerActivitiesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetServerActivitiesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception { - GetServerActivitiesResponse res = sdk.activities().getServerActivities() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerActivitiesResponse res = sdk.activities().getServerActivities() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetServerActivitiesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -1564,6 +1581,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -1571,6 +1589,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -1587,6 +1606,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -1594,6 +1614,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -1606,11 +1627,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -1625,7 +1651,7 @@ paths: } - lang: ruby label: cancelServerActivities - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.cancel_server_activities(activity_uuid=\"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.activities.cancel_server_activities(activity_uuid=\"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: cancelServerActivities source: |- @@ -1640,7 +1666,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -1657,45 +1687,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.CancelServerActivitiesBadRequest; + import dev.plexapi.plexapi.models.errors.CancelServerActivitiesUnauthorized; + import dev.plexapi.plexapi.models.operations.CancelServerActivitiesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception { - CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() .activityUUID("25b71ed5-0f9d-461c-baa7-d404e9e10d3e") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.CancelServerActivitiesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -1755,6 +1770,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -1762,6 +1778,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -1778,6 +1795,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -1785,6 +1803,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -1797,11 +1816,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -1815,7 +1839,7 @@ paths: } - lang: ruby label: getButlerTasks - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.get_butler_tasks()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.get_butler_tasks()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getButlerTasks source: |- @@ -1830,7 +1854,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -1847,46 +1875,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetButlerTasksBadRequest; + import dev.plexapi.plexapi.models.errors.GetButlerTasksUnauthorized; + import dev.plexapi.plexapi.models.operations.GetButlerTasksResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception { - GetButlerTasksResponse res = sdk.butler().getButlerTasks() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetButlerTasksResponse res = sdk.butler().getButlerTasks() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetButlerTasksResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -1921,6 +1934,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -1928,6 +1942,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -1944,6 +1959,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -1951,6 +1967,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -1963,11 +1980,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -1981,7 +2003,7 @@ paths: } - lang: ruby label: startAllTasks - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_all_tasks()\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_all_tasks()\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: startAllTasks source: |- @@ -1996,7 +2018,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2013,44 +2039,29 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StartAllTasksBadRequest; + import dev.plexapi.plexapi.models.errors.StartAllTasksUnauthorized; + import dev.plexapi.plexapi.models.operations.StartAllTasksResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception { - StartAllTasksResponse res = sdk.butler().startAllTasks() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StartAllTasksResponse res = sdk.butler().startAllTasks() .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StartAllTasksResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -2081,6 +2092,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -2088,6 +2100,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -2104,6 +2117,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -2111,6 +2125,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -2123,11 +2138,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -2141,7 +2161,7 @@ paths: } - lang: ruby label: stopAllTasks - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_all_tasks()\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_all_tasks()\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: stopAllTasks source: |- @@ -2156,7 +2176,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2173,44 +2197,29 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StopAllTasksBadRequest; + import dev.plexapi.plexapi.models.errors.StopAllTasksUnauthorized; + import dev.plexapi.plexapi.models.operations.StopAllTasksResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception { - StopAllTasksResponse res = sdk.butler().stopAllTasks() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StopAllTasksResponse res = sdk.butler().stopAllTasks() .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StopAllTasksResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -2270,6 +2279,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -2277,6 +2287,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -2293,6 +2304,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -2300,6 +2312,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -2313,11 +2326,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -2332,7 +2350,7 @@ paths: } - lang: ruby label: startTask - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_task(task_name=::PlexRubySDK::Operations::TaskName::CLEAN_OLD_BUNDLES)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.start_task(task_name=::PlexRubySDK::Operations::TaskName::CLEAN_OLD_BUNDLES)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: startTask source: |- @@ -2348,7 +2366,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2365,45 +2387,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StartTaskBadRequest; + import dev.plexapi.plexapi.models.errors.StartTaskUnauthorized; + import dev.plexapi.plexapi.models.operations.StartTaskResponse; + import dev.plexapi.plexapi.models.operations.TaskName; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception { - StartTaskResponse res = sdk.butler().startTask() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StartTaskResponse res = sdk.butler().startTask() .taskName(TaskName.CLEAN_OLD_BUNDLES) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StartTaskResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -2456,6 +2464,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -2463,6 +2472,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -2479,6 +2489,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -2486,6 +2497,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 '404': description: The task was not running @@ -2501,11 +2513,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -2520,7 +2537,7 @@ paths: } - lang: ruby label: stopTask - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_task(task_name=::PlexRubySDK::Operations::PathParamTaskName::BACKUP_DATABASE)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.butler.stop_task(task_name=::PlexRubySDK::Operations::PathParamTaskName::BACKUP_DATABASE)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: stopTask source: |- @@ -2536,7 +2553,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2553,45 +2574,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StopTaskBadRequest; + import dev.plexapi.plexapi.models.errors.StopTaskUnauthorized; + import dev.plexapi.plexapi.models.operations.PathParamTaskName; + import dev.plexapi.plexapi.models.operations.StopTaskResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception { - StopTaskResponse res = sdk.butler().stopTask() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StopTaskResponse res = sdk.butler().stopTask() .taskName(PathParamTaskName.BACKUP_DATABASE) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StopTaskResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -2671,6 +2678,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -2678,6 +2686,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -2694,6 +2703,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -2701,6 +2711,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -2713,11 +2724,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -2731,7 +2747,7 @@ paths: } - lang: ruby label: getAvailableClients - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_available_clients()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_available_clients()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getAvailableClients source: |- @@ -2746,7 +2762,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2763,46 +2783,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetAvailableClientsBadRequest; + import dev.plexapi.plexapi.models.errors.GetAvailableClientsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetAvailableClientsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception { - GetAvailableClientsResponse res = sdk.server().getAvailableClients() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetAvailableClientsResponse res = sdk.server().getAvailableClients() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetAvailableClientsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -2866,6 +2871,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -2873,6 +2879,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -2889,6 +2896,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -2896,6 +2904,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -2908,11 +2917,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -2926,7 +2940,7 @@ paths: } - lang: ruby label: getDevices - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_devices()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_devices()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getDevices source: |- @@ -2941,7 +2955,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -2958,46 +2976,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetDevicesBadRequest; + import dev.plexapi.plexapi.models.errors.GetDevicesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetDevicesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception { - GetDevicesResponse res = sdk.server().getDevices() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetDevicesResponse res = sdk.server().getDevices() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetDevicesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -3063,6 +3066,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -3070,6 +3074,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -3086,6 +3091,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -3093,11 +3099,43 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: getCompanionsData + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $response = $sdk->plex->getCompanionsData(); + + if ($response->responseBodies !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: getCompanionsData - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_companions_data()\n\nif ! res.response_bodies.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_companions_data()\n\nif ! res.response_bodies.nil?\n # handle response\nend" - lang: go label: getCompanionsData source: |- @@ -3112,7 +3150,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -3124,6 +3166,38 @@ paths: // handle response } } + - lang: java + label: getCompanionsData + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetCompanionsDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetCompanionsDataUnauthorized; + import dev.plexapi.plexapi.models.operations.GetCompanionsDataResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetCompanionsDataResponse res = sdk.plex().getCompanionsData() + .call(); + + if (res.responseBodies().isPresent()) { + // handle response + } + } + } - lang: typescript label: getCompanionsData source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getCompanionsData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -3243,6 +3317,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -3250,6 +3325,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -3266,6 +3342,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -3273,11 +3350,43 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: getUserFriends + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $response = $sdk->plex->getUserFriends(); + + if ($response->friends !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: getUserFriends - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_user_friends()\n\nif ! res.friends.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_user_friends()\n\nif ! res.friends.nil?\n # handle response\nend" - lang: go label: getUserFriends source: |- @@ -3292,7 +3401,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -3304,6 +3417,38 @@ paths: // handle response } } + - lang: java + label: getUserFriends + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetUserFriendsBadRequest; + import dev.plexapi.plexapi.models.errors.GetUserFriendsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetUserFriendsResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetUserFriendsResponse res = sdk.plex().getUserFriends() + .call(); + + if (res.friends().isPresent()) { + // handle response + } + } + } - lang: typescript label: getUserFriends source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getUserFriends();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -3377,9 +3522,9 @@ paths: description: The time zone of the country. example: America/St_Thomas postal_code: - type: integer + type: string description: The postal code of the location. - example: 802 + example: '802' in_privacy_restricted_country: type: boolean description: Indicates if the country has privacy restrictions. @@ -3413,6 +3558,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -3420,6 +3566,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -3436,6 +3583,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -3443,11 +3591,38 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: getGeoData + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->build(); + + try { + $response = $sdk->plex->getGeoData(); + + if ($response->geoData !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: getGeoData - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\n\n \nres = s.plex.get_geo_data()\n\nif ! res.geo_data.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\n\n \nres = s.plex.get_geo_data()\n\nif ! res.geo_data.nil?\n # handle response\nend" - lang: go label: getGeoData source: |- @@ -3461,7 +3636,11 @@ paths: func main() { s := plexgo.New( - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -3473,6 +3652,37 @@ paths: // handle response } } + - lang: java + label: getGeoData + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetGeoDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetGeoDataUnauthorized; + import dev.plexapi.plexapi.models.operations.GetGeoDataResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetGeoDataBadRequest, GetGeoDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetGeoDataResponse res = sdk.plex().getGeoData() + .call(); + + if (res.geoData().isPresent()) { + // handle response + } + } + } - lang: typescript label: getGeoData source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getGeoData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -3522,6 +3732,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -3529,6 +3740,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -3545,6 +3757,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -3552,6 +3765,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -3564,11 +3778,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -3582,7 +3801,7 @@ paths: } - lang: ruby label: getHomeData - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_home_data()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_home_data()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getHomeData source: |- @@ -3597,7 +3816,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -3614,46 +3837,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetHomeDataBadRequest; + import dev.plexapi.plexapi.models.errors.GetHomeDataUnauthorized; + import dev.plexapi.plexapi.models.operations.GetHomeDataResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception { - GetHomeDataResponse res = sdk.plex().getHomeData() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetHomeDataResponse res = sdk.plex().getHomeData() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetHomeDataResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -3816,6 +4024,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -3823,6 +4032,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -3839,6 +4049,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -3846,6 +4057,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -3859,11 +4071,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -3878,7 +4095,7 @@ paths: } - lang: ruby label: getGlobalHubs - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_global_hubs(count=1262.49, only_transient=::PlexRubySDK::Operations::OnlyTransient::ONE)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_global_hubs(count=1262.49, only_transient=::PlexRubySDK::Operations::OnlyTransient::ONE)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getGlobalHubs source: |- @@ -3893,7 +4110,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -3910,53 +4131,1028 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetGlobalHubsBadRequest; + import dev.plexapi.plexapi.models.errors.GetGlobalHubsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetGlobalHubsResponse; + import dev.plexapi.plexapi.models.operations.OnlyTransient; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception { - GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() .count(1262.49d) .onlyTransient(OnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetGlobalHubsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript label: getGlobalHubs source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.hubs.getGlobalHubs();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + /hubs/home/recentlyAdded: + get: + tags: + - Hubs + summary: Get Recently Added + description: | + This endpoint will return the recently added content. + operationId: get-recently-added + parameters: + - name: contentDirectoryID + in: query + required: true + schema: + type: integer + description: The content directory ID. + - name: pinnedContentDirectoryID + in: query + required: false + schema: + type: string + description: Comma-separated list of pinned content directory IDs. + - name: sectionID + in: query + required: false + description: The library section ID for filtering content. + schema: + type: integer + example: 2 + - name: type + in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + schema: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + example: 2 + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE + required: true + - name: includeMeta + in: query + description: | + Adds the Meta object to the response + schema: + type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - name: X-Plex-Container-Start + in: query + description: | + The index of the first item to return. If not specified, the first item will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 0 + schema: + type: integer + format: int32 + default: 0 + example: 0 + required: false + - name: X-Plex-Container-Size + in: query + description: | + The number of items to return. If not specified, all items will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 50 + schema: + type: integer + format: int32 + default: 50 + example: 50 + required: false + responses: + '200': + description: A successful response with recently added content. + content: + application/json: + schema: + type: object + properties: + MediaContainer: + allOf: + - type: object + required: + - size + properties: + size: + type: number + example: 50 + offset: + type: integer + format: int32 + totalSize: + type: integer + format: int32 + identifier: + type: string + example: com.plexapp.plugins.library + allowSync: + type: boolean + - type: object + properties: + Meta: + type: object + description: | + The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + properties: + Type: + type: array + items: + type: object + required: + - key + - type + - title + - active + properties: + key: + type: string + example: /library/sections/2/all?type=2 + type: + type: string + example: show + title: + type: string + example: TV Shows + active: + type: boolean + example: false + Filter: + type: array + items: + type: object + required: + - filter + - filterType + - key + - title + - type + properties: + filter: + type: string + example: genre + filterType: + type: string + example: string + key: + type: string + example: /library/sections/2/genre?type=2 + title: + type: string + example: Genre + type: + type: string + example: filter + Sort: + type: array + items: + type: object + required: + - key + - title + - defaultDirection + properties: + default: + type: string + example: asc + active: + type: boolean + example: false + activeDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + defaultDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + descKey: + type: string + example: 'titleSort:desc' + firstCharacterKey: + type: string + example: /library/sections/2/firstCharacter + key: + type: string + example: titleSort + title: + type: string + example: Title + Field: + type: array + items: + type: object + required: + - key + - title + - type + properties: + key: + type: string + example: show.title + title: + type: string + example: Show Title + type: + type: string + example: string + subType: + type: string + example: rating + FieldType: + type: array + items: + type: object + required: + - type + - Operator + properties: + type: + type: string + example: tag + Operator: + type: array + items: + type: object + required: + - key + - title + properties: + key: + type: string + example: '=' + title: + type: string + example: is + Metadata: + type: array + items: + type: object + required: + - ratingKey + - key + - guid + - title + - type + - addedAt + - summary + properties: + ratingKey: + type: string + example: '58683' + description: | + The rating key (Media ID) of this media item. + Note: This is always an integer, but is represented as a string in the API. + key: + type: string + example: /library/metadata/58683 + guid: + type: string + example: 'plex://movie/5d7768ba96b655001fdc0408' + studio: + type: string + example: 20th Century Studios + skipChildren: + type: boolean + example: false + librarySectionID: + type: integer + examples: + - 1 + librarySectionTitle: + type: string + example: Movies + librarySectionKey: + type: string + example: /library/sections/1 + type: + type: string + enum: + - movie + - show + - season + - episode + example: movie + description: | + The type of media content + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE + title: + type: string + example: 'Avatar: The Way of Water' + slug: + type: string + example: 4-for-texas + contentRating: + type: string + example: PG-13 + summary: + type: string + example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.' + rating: + type: number + example: 7.6 + audienceRating: + type: number + example: 9.2 + year: + type: integer + format: int32 + example: 2022 + seasonCount: + type: integer + format: int32 + example: 2022 + tagline: + type: string + example: Return to Pandora. + flattenSeasons: + type: string + enum: + - '0' + - '1' + example: '1' + default: '0' + x-speakeasy-enums: + - false + - true + showOrdering: + type: string + description: "Setting that indicates the episode ordering for the show \nNone = Library default, \ntmdbAiring = The Movie Database (Aired), \naired = TheTVDB (Aired), \ndvd = TheTVDB (DVD), \nabsolute = TheTVDB (Absolute)).\n" + enum: + - None + - tmdbAiring + - aired + - dvd + - absolute + x-speakeasy-enums: + - NONE + - TMDB_AIRING + - AIRED + - DVD + - ABSOLUTE + example: dvd + thumb: + type: string + example: /library/metadata/58683/thumb/1703239236 + art: + type: string + example: /library/metadata/58683/art/1703239236 + banner: + type: string + example: /library/metadata/58683/banner/1703239236 + duration: + type: integer + format: int32 + example: 11558112 + originallyAvailableAt: + type: string + format: date + example: 2022-12-14T00:00:00.000Z + addedAt: + type: + - integer + example: 1556281940 + description: Unix epoch datetime in seconds + format: int64 + updatedAt: + type: + - integer + example: 1556281940 + description: Unix epoch datetime in seconds + format: int64 + audienceRatingImage: + type: string + example: 'rottentomatoes://image.rating.upright' + chapterSource: + type: string + example: media + primaryExtraKey: + type: string + example: /library/metadata/58684 + ratingImage: + type: string + example: 'rottentomatoes://image.rating.ripe' + grandparentRatingKey: + type: string + example: '66' + grandparentGuid: + type: string + example: 'plex://show/5d9c081b170e24001f2a7be4' + grandparentKey: + type: string + example: /library/metadata/66 + grandparentTitle: + type: string + example: Caprica + grandparentThumb: + type: string + example: /library/metadata/66/thumb/1705716261 + parentSlug: + type: string + example: alice-in-borderland-2020 + grandparentSlug: + type: string + example: alice-in-borderland-2020 + grandparentArt: + type: string + example: /library/metadata/66/art/1705716261 + grandparentTheme: + type: string + example: /library/metadata/66/theme/1705716261 + Media: + description: | + The Media object is only included when type query is `4` or higher. + type: array + items: + type: object + required: + - id + - duration + - bitrate + - width + - height + - aspectRatio + - audioChannels + - audioCodec + - videoCodec + - videoResolution + - container + - videoFrameRate + - videoProfile + - Part + properties: + id: + type: integer + format: int32 + example: 119534 + duration: + type: integer + format: int32 + example: 11558112 + bitrate: + type: integer + format: int32 + example: 25025 + width: + type: integer + format: int32 + example: 3840 + height: + type: integer + format: int32 + example: 2072 + aspectRatio: + type: number + example: 1.85 + audioProfile: + type: string + example: dts + audioChannels: + type: integer + format: int32 + example: 6 + audioCodec: + type: string + example: eac3 + videoCodec: + type: string + example: hevc + videoResolution: + type: string + example: 4k + container: + type: string + example: mkv + videoFrameRate: + type: string + example: 24p + videoProfile: + type: string + example: main 10 + hasVoiceActivity: + type: boolean + example: false + optimizedForStreaming: + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + has64bitOffsets: + type: boolean + example: false + Part: + type: array + items: + type: object + required: + - id + - key + - duration + - file + - size + - container + - videoProfile + properties: + id: + type: integer + format: int32 + example: 119542 + key: + type: string + example: /library/parts/119542/1680457526/file.mkv + duration: + type: integer + format: int32 + example: 11558112 + file: + type: string + example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv + size: + type: integer + format: int64 + example: 36158371307 + container: + type: string + description: | + The container format of the media file. + example: mkv + audioProfile: + type: string + example: dts + has64bitOffsets: + type: boolean + example: false + optimizedForStreaming: + type: boolean + example: false + videoProfile: + type: string + example: main 10 + indexes: + type: string + example: sd + hasThumbnail: + type: string + enum: + - '0' + - '1' + example: '1' + default: '0' + x-speakeasy-enums: + - false + - true + Stream: + type: array + items: + type: object + required: + - id + - streamType + - codec + - index + properties: + id: + type: integer + example: 272796 + streamType: + type: integer + description: 'Type of stream (1 = video, 2 = audio, 3 = subtitle)' + example: 1 + default: + type: boolean + description: Indicates if this is the default stream + example: true + selected: + type: boolean + description: Indicates if the stream is selected + example: true + codec: + type: string + description: Codec used by the stream + example: h264 + index: + type: integer + description: The index of the stream + example: 0 + bitrate: + type: integer + description: The bitrate of the stream in kbps + example: 6273 + colorPrimaries: + type: string + description: The color primaries of the video stream + example: bt709 + colorRange: + type: string + description: The color range of the video stream + example: tv + colorSpace: + type: string + description: The color space of the video stream + example: bt709 + colorTrc: + type: string + description: The transfer characteristics (TRC) of the video stream + example: bt709 + bitDepth: + type: integer + description: The bit depth of the video stream + example: 8 + chromaLocation: + type: string + description: The chroma location of the video stream + example: left + streamIdentifier: + type: string + description: The identifier of the video stream + example: '2' + chromaSubsampling: + type: string + description: The chroma subsampling format + example: '4:2:0' + codedHeight: + type: integer + description: The coded height of the video stream + example: 1088 + codedWidth: + type: integer + description: The coded width of the video stream + example: 1920 + frameRate: + type: number + description: The frame rate of the video stream + example: 29.97 + hasScalingMatrix: + type: boolean + description: Indicates if the stream has a scaling matrix + example: false + hearingImpaired: + type: boolean + example: false + closedCaptions: + type: boolean + example: false + embeddedInVideo: + type: string + example: '1' + height: + type: integer + description: The height of the video stream + example: 1080 + level: + type: integer + description: The level of the video codec + example: 40 + profile: + type: string + description: The profile of the video codec + example: main + refFrames: + type: integer + description: Number of reference frames + example: 4 + scanType: + type: string + description: The scan type (progressive or interlaced) + example: progressive + width: + type: integer + description: The width of the video stream + example: 1920 + displayTitle: + type: string + description: Display title of the stream + example: 1080p (H.264) + extendedDisplayTitle: + type: string + description: Extended display title of the stream + example: 1080p (H.264) + channels: + type: integer + description: Number of audio channels (for audio streams) + example: 2 + language: + type: string + description: The language of the stream (for audio/subtitle streams) + example: English + languageTag: + type: string + description: Language tag of the stream + example: en + languageCode: + type: string + description: Language code of the stream + example: eng + audioChannelLayout: + type: string + description: The audio channel layout + example: stereo + samplingRate: + type: integer + description: Sampling rate of the audio stream in Hz + example: 48000 + title: + type: string + description: Title of the subtitle track (for subtitle streams) + example: English + canAutoSync: + type: boolean + description: Indicates if the subtitle stream can auto-sync + example: false + Genre: + type: array + items: + type: object + properties: + tag: + type: string + example: Adventure + Country: + type: array + items: + type: object + properties: + tag: + type: string + example: United States of America + Director: + type: array + items: + type: object + properties: + tag: + type: string + example: James Cameron + Writer: + type: array + items: + type: object + properties: + tag: + type: string + example: James Cameron + Collection: + type: array + items: + type: object + properties: + tag: + type: string + example: Working NL Subs + Role: + type: array + items: + type: object + properties: + id: + type: integer + description: The ID of the tag or actor. + example: 294129 + filter: + type: string + description: The filter used to find the actor or tag. + example: actor=294129 + thumb: + type: string + description: The thumbnail of the actor + example: 'https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg' + tag: + type: string + description: The name of the tag or actor. + example: Mike Smith + tagKey: + type: string + description: Unique identifier for the tag. + example: 668e7e7b22bcad9064350c91 + role: + type: string + description: The role of the actor or tag in the media. + example: Self + Guid: + x-speakeasy-name-override: MediaGuid + description: | + The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: | + Can be one of the following formats: + imdb://tt13015952, tmdb://2434012, tvdb://7945991 + example: 'imdb://tt13015952' + UltraBlurColors: + type: object + required: + - topLeft + - topRight + - bottomRight + - bottomLeft + properties: + topLeft: + type: string + example: 11333b + topRight: + type: string + example: 0a232d + bottomRight: + type: string + example: 073958 + bottomLeft: + type: string + example: 1f5066 + Rating: + x-speakeasy-name-override: MetaDataRating + type: array + items: + type: object + required: + - image + - value + - type + properties: + image: + type: string + description: A URI or path to the rating image. + example: 'themoviedb://image.rating' + value: + type: number + format: float + description: The value of the rating. + example: 3 + type: + type: string + description: 'The type of rating (e.g., audience, critic).' + example: audience + Image: + type: array + items: + type: object + required: + - alt + - type + - url + properties: + alt: + type: string + example: Episode 1 + type: + type: string + enum: + - coverPoster + - background + - snapshot + - clearLogo + example: background + url: + type: string + example: /library/metadata/45521/thumb/1644710589 + titleSort: + type: string + example: Whale + viewCount: + type: integer + format: int32 + example: 1 + lastViewedAt: + type: integer + format: int32 + example: 1682752242 + originalTitle: + type: string + example: 映画 ブラッククローバー 魔法帝の剣 + viewOffset: + type: integer + format: int32 + example: 5222500 + skipCount: + type: integer + format: int32 + example: 1 + index: + type: integer + format: int32 + example: 1 + theme: + type: string + example: /library/metadata/1/theme/1705636920 + leafCount: + type: integer + format: int32 + example: 14 + viewedLeafCount: + type: integer + format: int32 + example: 0 + childCount: + type: integer + format: int32 + example: 1 + hasPremiumExtras: + type: string + example: '1' + hasPremiumPrimaryExtra: + type: string + example: '1' + parentRatingKey: + type: string + description: | + The rating key of the parent item. + example: '66' + parentGuid: + type: string + example: 'plex://show/5d9c081b170e24001f2a7be4' + parentStudio: + type: string + example: UCP + parentKey: + type: string + example: /library/metadata/66 + parentTitle: + type: string + example: Caprica + parentIndex: + type: integer + format: int32 + example: 1 + parentYear: + type: integer + format: int32 + example: 2010 + parentThumb: + type: string + example: /library/metadata/66/thumb/1705716261 + parentTheme: + type: string + example: /library/metadata/66/theme/1705716261 + '400': + description: 'Bad request, invalid parameters.' + '401': + description: 'Unauthorized, invalid Plex token.' /hubs/search: get: tags: @@ -4017,6 +5213,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -4024,6 +5221,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -4040,6 +5238,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -4047,6 +5246,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -4059,16 +5259,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->search->performSearch('dylan', 1516.53, 5); + $response = $sdk->search->performSearch('dylan', 5838.67, 5); if ($response->statusCode === 200) { // handle response @@ -4078,7 +5283,7 @@ paths: } - lang: ruby label: performSearch - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_search(query=\"arnold\", section_id=9372.7, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_search(query=\"dylan\", section_id=5838.67, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: performSearch source: |- @@ -4093,7 +5298,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -4110,47 +5319,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.PerformSearchBadRequest; + import dev.plexapi.plexapi.models.errors.PerformSearchUnauthorized; + import dev.plexapi.plexapi.models.operations.PerformSearchResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception { - PerformSearchResponse res = sdk.search().performSearch() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + PerformSearchResponse res = sdk.search().performSearch() .query("dylan") - .sectionId(1516.53d) + .sectionId(5838.67d) .limit(5d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.PerformSearchResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -4204,6 +5398,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -4211,6 +5406,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -4227,6 +5423,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -4234,6 +5431,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -4246,16 +5444,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->search->performVoiceSearch('dead+poop', 4094.8, 5); + $response = $sdk->search->performVoiceSearch('dead+poop', 4094.80, 5); if ($response->statusCode === 200) { // handle response @@ -4265,7 +5468,7 @@ paths: } - lang: ruby label: performVoiceSearch - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_voice_search(query=\"dead+poop\", section_id=4094.8, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.perform_voice_search(query=\"dead+poop\", section_id=4094.80, limit=5.0)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: performVoiceSearch source: |- @@ -4280,7 +5483,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -4297,47 +5504,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.PerformVoiceSearchBadRequest; + import dev.plexapi.plexapi.models.errors.PerformVoiceSearchUnauthorized; + import dev.plexapi.plexapi.models.operations.PerformVoiceSearchResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception { - PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() .query("dead+poop") - .sectionId(4094.8d) + .sectionId(4094.80d) .limit(5d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.PerformVoiceSearchResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -4694,6 +5886,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -4701,6 +5894,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -4717,6 +5911,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -4724,6 +5919,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -4737,16 +5933,21 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->hubs->getLibraryHubs(6728.76, 9010.22, Operations\QueryParamOnlyTransient::Zero); + $response = $sdk->hubs->getLibraryHubs(6728.76, 639.24, Operations\QueryParamOnlyTransient::One); if ($response->object !== null) { // handle response @@ -4756,7 +5957,7 @@ paths: } - lang: ruby label: getLibraryHubs - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=::PlexRubySDK::Operations::QueryParamOnlyTransient::ZERO)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.hubs.get_library_hubs(section_id=6728.76, count=639.24, only_transient=::PlexRubySDK::Operations::QueryParamOnlyTransient::ONE)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getLibraryHubs source: |- @@ -4771,7 +5972,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -4788,49 +5993,35 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetLibraryHubsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryHubsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetLibraryHubsResponse; + import dev.plexapi.plexapi.models.operations.QueryParamOnlyTransient; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception { - GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() .sectionId(6728.76d) - .count(9010.22d) - .onlyTransient(QueryParamOnlyTransient.ZERO) + .count(639.24d) + .onlyTransient(QueryParamOnlyTransient.ONE) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryHubsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -4876,6 +6067,7 @@ paths: properties: code: type: integer + format: int32 example: 408 message: type: string @@ -4883,21 +6075,21 @@ paths: example: The server timed out waiting for the request. x-codeSamples: - lang: php - label: getServerIdentity + label: identity source: |- declare(strict_types=1); require 'vendor/autoload.php'; use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - - $security = new Components\Security(); - $security->accessToken = ''; $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->build(); try { $response = $sdk->server->getServerIdentity(); @@ -4910,7 +6102,7 @@ paths: } - lang: ruby label: identity - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\n\n \nres = s.server.get_server_identity()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\n\n \nres = s.server.get_server_identity()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: identity source: |- @@ -4924,7 +6116,11 @@ paths: func main() { s := plexgo.New( - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -4937,50 +6133,33 @@ paths: } } - lang: java - label: getServerIdentity + label: identity source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerIdentityRequestTimeout; + import dev.plexapi.plexapi.models.operations.GetServerIdentityResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetServerIdentityRequestTimeout, Exception { - GetServerIdentityResponse res = sdk.server().getServerIdentity() + PlexAPI sdk = PlexAPI.builder() + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerIdentityResponse res = sdk.server().getServerIdentity() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetServerIdentityResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -5025,6 +6204,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -5032,6 +6212,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -5048,6 +6229,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -5055,6 +6237,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -5067,11 +6250,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -5086,7 +6274,7 @@ paths: } - lang: ruby label: getFileHash - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_file_hash(url=\"file://C:\\Image.png&type=13\", type=4462.17)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_file_hash(url=\"file://C:\\Image.png&type=13\", type=4462.17)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: getFileHash source: |- @@ -5101,7 +6289,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -5118,46 +6310,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetFileHashBadRequest; + import dev.plexapi.plexapi.models.errors.GetFileHashUnauthorized; + import dev.plexapi.plexapi.models.operations.GetFileHashResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception { - GetFileHashResponse res = sdk.library().getFileHash() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetFileHashResponse res = sdk.library().getFileHash() .url("file://C:\Image.png&type=13") .type(4462.17d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.GetFileHashResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -5170,8 +6347,79 @@ paths: summary: Get Recently Added description: | This endpoint will return the recently added content. - operationId: getRecentlyAdded + operationId: get-recently-added-library parameters: + - name: contentDirectoryID + in: query + required: false + schema: + type: integer + example: 2 + - name: pinnedContentDirectoryID + in: query + required: false + schema: + type: array + items: + type: integer + example: + - 3 + - 5 + - 7 + - 13 + - 12 + - 1 + - 6 + - 14 + - 2 + - 10 + - 16 + - 17 + - name: sectionID + in: query + required: false + description: The library section ID for filtering content. + schema: + type: integer + example: 2 + - name: type + in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + schema: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + example: 2 + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE + required: true + - name: includeMeta + in: query + description: | + Adds the Meta object to the response + schema: + type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE - name: X-Plex-Container-Start in: query description: | @@ -5205,229 +6453,379 @@ paths: type: object properties: MediaContainer: - type: object - properties: - size: - type: number - example: 50 - allowSync: - type: boolean - identifier: - type: string - example: com.plexapp.plugins.library - mediaTagPrefix: - type: string - example: /system/bundle/media/flags/ - mediaTagVersion: - type: number - example: 1680021154 - mixedParents: - type: boolean - Metadata: - type: array - items: - type: object - properties: - allowSync: - type: boolean - librarySectionID: - type: number - example: 1 - librarySectionTitle: - type: string - example: Movies - librarySectionUUID: - type: string - example: 322a231a-b7f7-49f5-920f-14c61199cd30 - ratingKey: - type: number - example: 59398 - key: - type: string - example: /library/metadata/59398 - guid: - type: string - example: 'plex://movie/5e161a83bea6ac004126e148' - studio: - type: string - example: Marvel Studios - type: - type: string - example: movie - title: - type: string - example: 'Ant-Man and the Wasp: Quantumania' - contentRating: - type: string - example: PG-13 - summary: - type: string - example: Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. - rating: - type: number - example: 4.7 - audienceRating: - type: number - example: 8.3 - year: - type: number - example: 2023 - tagline: - type: string - example: Witness the beginning of a new dynasty. - thumb: - type: string - example: /library/metadata/59398/thumb/1681888010 - art: - type: string - example: /library/metadata/59398/art/1681888010 - duration: - type: number - example: 7474422 - originallyAvailableAt: - type: string - format: date-time - example: 2023-02-15T00:00:00.000Z - addedAt: - type: number - example: 1681803215 - updatedAt: - type: number - example: 1681888010 - audienceRatingImage: - type: string - example: 'rottentomatoes://image.rating.upright' - chapterSource: - type: string - example: media - primaryExtraKey: - type: string - example: /library/metadata/59399 - ratingImage: - type: string - example: 'rottentomatoes://image.rating.rotten' - Media: - type: array - items: - type: object - properties: - id: - type: number - example: 120345 - duration: - type: number - example: 7474422 - bitrate: - type: number - example: 3623 - width: - type: number - example: 1920 - height: - type: number - example: 804 - aspectRatio: - type: number - example: 2.35 - audioChannels: - type: number - example: 6 - audioCodec: - type: string - example: ac3 - videoCodec: - type: string - example: h264 - videoResolution: - type: number - example: 1080 - container: - type: string - example: mp4 - videoFrameRate: - type: string - example: 24p - optimizedForStreaming: - type: number - example: 0 - has64bitOffsets: - type: boolean - videoProfile: - type: string - example: high - Part: - type: array - items: - type: object - properties: - id: - type: number - example: 120353 - key: - type: string - example: /library/parts/120353/1681803203/file.mp4 - duration: - type: number - example: 7474422 - file: - type: string - example: /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4 - size: - type: number - example: 3395307162 - container: - type: string - example: mp4 - has64bitOffsets: - type: boolean - hasThumbnail: - type: number - example: 1 - optimizedForStreaming: - type: boolean - videoProfile: - type: string - example: high - Genre: - type: array - items: - type: object - properties: - tag: - type: string - example: Comedy - Director: - type: array - items: - type: object - properties: - tag: - type: string - example: Peyton Reed - Writer: - type: array - items: - type: object - properties: - tag: - type: string - example: Jeff Loveness - Country: - type: array - items: - type: object - properties: - tag: - type: string - example: United States of America - Role: - type: array - items: - type: object - properties: - tag: - type: string - example: Paul Rudd + allOf: + - type: object + description: | + The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + properties: + Type: + type: array + items: + type: object + required: + - key + - type + - title + - active + properties: + key: + type: string + example: /library/sections/2/all?type=2 + type: + type: string + example: show + title: + type: string + example: TV Shows + active: + type: boolean + example: false + Filter: + type: array + items: + type: object + required: + - filter + - filterType + - key + - title + - type + properties: + filter: + type: string + example: genre + filterType: + type: string + example: string + key: + type: string + example: /library/sections/2/genre?type=2 + title: + type: string + example: Genre + type: + type: string + example: filter + Sort: + type: array + items: + type: object + required: + - key + - title + - defaultDirection + properties: + default: + type: string + example: asc + active: + type: boolean + example: false + activeDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + defaultDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + descKey: + type: string + example: 'titleSort:desc' + firstCharacterKey: + type: string + example: /library/sections/2/firstCharacter + key: + type: string + example: titleSort + title: + type: string + example: Title + Field: + type: array + items: + type: object + required: + - key + - title + - type + properties: + key: + type: string + example: show.title + title: + type: string + example: Show Title + type: + type: string + example: string + subType: + type: string + example: rating + FieldType: + type: array + items: + type: object + required: + - type + - Operator + properties: + type: + type: string + example: tag + Operator: + type: array + items: + type: object + required: + - key + - title + properties: + key: + type: string + example: '=' + title: + type: string + example: is + - type: object + properties: + size: + type: number + example: 50 + allowSync: + type: boolean + identifier: + type: string + example: com.plexapp.plugins.library + mediaTagPrefix: + type: string + example: /system/bundle/media/flags/ + mediaTagVersion: + type: number + example: 1680021154 + mixedParents: + type: boolean + Metadata: + type: array + items: + type: object + properties: + allowSync: + type: boolean + librarySectionID: + type: number + example: 1 + librarySectionTitle: + type: string + example: Movies + librarySectionUUID: + type: string + example: 322a231a-b7f7-49f5-920f-14c61199cd30 + ratingKey: + type: number + example: 59398 + key: + type: string + example: /library/metadata/59398 + guid: + type: string + example: 'plex://movie/5e161a83bea6ac004126e148' + studio: + type: string + example: Marvel Studios + type: + type: string + example: movie + title: + type: string + example: 'Ant-Man and the Wasp: Quantumania' + contentRating: + type: string + example: PG-13 + summary: + type: string + example: Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. + rating: + type: number + example: 4.7 + audienceRating: + type: number + example: 8.3 + year: + type: number + example: 2023 + tagline: + type: string + example: Witness the beginning of a new dynasty. + thumb: + type: string + example: /library/metadata/59398/thumb/1681888010 + art: + type: string + example: /library/metadata/59398/art/1681888010 + duration: + type: number + example: 7474422 + originallyAvailableAt: + type: string + format: date-time + example: 2023-02-15T00:00:00.000Z + addedAt: + type: number + example: 1681803215 + updatedAt: + type: number + example: 1681888010 + audienceRatingImage: + type: string + example: 'rottentomatoes://image.rating.upright' + chapterSource: + type: string + example: media + primaryExtraKey: + type: string + example: /library/metadata/59399 + ratingImage: + type: string + example: 'rottentomatoes://image.rating.rotten' + Media: + type: array + items: + type: object + properties: + id: + type: number + example: 120345 + duration: + type: number + example: 7474422 + bitrate: + type: number + example: 3623 + width: + type: number + example: 1920 + height: + type: number + example: 804 + aspectRatio: + type: number + example: 2.35 + audioChannels: + type: number + example: 6 + audioCodec: + type: string + example: ac3 + videoCodec: + type: string + example: h264 + videoResolution: + type: number + example: 1080 + container: + type: string + example: mp4 + videoFrameRate: + type: string + example: 24p + optimizedForStreaming: + type: number + example: 0 + has64bitOffsets: + type: boolean + videoProfile: + type: string + example: high + Part: + type: array + items: + type: object + properties: + id: + type: number + example: 120353 + key: + type: string + example: /library/parts/120353/1681803203/file.mp4 + duration: + type: number + example: 7474422 + file: + type: string + example: /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4 + size: + type: number + example: 3395307162 + container: + type: string + example: mp4 + has64bitOffsets: + type: boolean + hasThumbnail: + type: number + example: 1 + optimizedForStreaming: + type: boolean + videoProfile: + type: string + example: high + Genre: + type: array + items: + type: object + properties: + tag: + type: string + example: Comedy + Director: + type: array + items: + type: object + properties: + tag: + type: string + example: Peyton Reed + Writer: + type: array + items: + type: object + properties: + tag: + type: string + example: Jeff Loveness + Country: + type: array + items: + type: object + properties: + tag: + type: string + example: United States of America + Role: + type: array + items: + type: object + properties: + tag: + type: string + example: Paul Rudd '400': description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' content: @@ -5443,6 +6841,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -5450,6 +6849,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -5466,6 +6866,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -5473,6 +6874,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -5485,15 +6887,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->library->getRecentlyAdded(); + + $response = $sdk->library->getRecentlyAdded(0, 50); if ($response->object !== null) { // handle response @@ -5503,7 +6911,7 @@ paths: } - lang: ruby label: getRecentlyAdded - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_recently_added(x_plex_container_start=0, x_plex_container_size=50)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_recently_added(x_plex_container_start=0, x_plex_container_size=50)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getRecentlyAdded source: |- @@ -5518,7 +6926,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -5535,46 +6947,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetRecentlyAddedBadRequest; + import dev.plexapi.plexapi.models.errors.GetRecentlyAddedUnauthorized; + import dev.plexapi.plexapi.models.operations.GetRecentlyAddedResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetRecentlyAddedBadRequest, GetRecentlyAddedUnauthorized, Exception { - GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetRecentlyAddedResponse res = sdk.library().getRecentlyAdded() + .xPlexContainerStart(0) + .xPlexContainerSize(50) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetRecentlyAddedResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -5594,6 +6993,8 @@ paths: application/json: schema: type: object + required: + - MediaContainer properties: MediaContainer: type: object @@ -5601,6 +7002,7 @@ paths: - size - allowSync - title1 + - Directory properties: size: type: integer @@ -5616,6 +7018,28 @@ paths: type: array items: type: object + required: + - allowSync + - art + - composite + - filters + - refreshing + - thumb + - key + - type + - title + - agent + - scanner + - language + - uuid + - updatedAt + - createdAt + - scannedAt + - content + - directory + - contentChangedAt + - hidden + - Location properties: allowSync: type: boolean @@ -5660,19 +7084,19 @@ paths: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 createdAt: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 scannedAt: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 content: type: boolean @@ -5681,9 +7105,11 @@ paths: type: boolean example: true contentChangedAt: - type: integer - format: int32 - example: 3192854 + type: + - integer + example: 1556281940 + description: Unix epoch datetime in seconds + format: int64 hidden: type: integer format: int32 @@ -5692,6 +7118,9 @@ paths: type: array items: type: object + required: + - id + - path properties: id: type: integer @@ -5715,6 +7144,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -5722,6 +7152,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -5738,6 +7169,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -5745,10 +7177,11 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php - label: getLibraries + label: libraries source: |- declare(strict_types=1); @@ -5757,15 +7190,20 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->library->getLibraries(); + $response = $sdk->library->getAllLibraries(); if ($response->object !== null) { // handle response @@ -5775,7 +7213,7 @@ paths: } - lang: ruby label: libraries - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_all_libraries()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_all_libraries()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: libraries source: |- @@ -5790,7 +7228,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -5803,50 +7245,35 @@ paths: } } - lang: java - label: getLibraries + label: libraries source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetAllLibrariesBadRequest; + import dev.plexapi.plexapi.models.errors.GetAllLibrariesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetAllLibrariesResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception { - GetLibrariesResponse res = sdk.library().getLibraries() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetAllLibrariesResponse res = sdk.library().getAllLibraries() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetLibrariesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -6060,6 +7487,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -6067,6 +7495,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -6083,6 +7512,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -6090,11 +7520,45 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: details + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->library->getLibraryDetails(9518, Operations\IncludeDetails::Zero); + + if ($response->object !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: details - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_library_details(section_key=9518, include_details=::PlexRubySDK::Operations::IncludeDetails::ZERO)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_library_details(section_key=9518, include_details=::PlexRubySDK::Operations::IncludeDetails::ZERO)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: details source: |- @@ -6109,7 +7573,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -6121,6 +7589,41 @@ paths: // handle response } } + - lang: java + label: details + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetLibraryDetailsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryDetailsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetLibraryDetailsResponse; + import dev.plexapi.plexapi.models.operations.IncludeDetails; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() + .sectionKey(9518) + .includeDetails(IncludeDetails.ZERO) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } + } - lang: typescript label: details source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryDetails(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -6157,6 +7660,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -6164,6 +7668,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -6180,6 +7685,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -6187,11 +7693,44 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: deleteLibrary + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->library->deleteLibrary(9518); + + if ($response->statusCode === 200) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: deleteLibrary - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.delete_library(section_key=9518)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.delete_library(section_key=9518)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: deleteLibrary source: |- @@ -6206,7 +7745,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -6215,6 +7758,37 @@ paths: log.Fatal(err) } if res != nil { + // handle response + } + } + - lang: java + label: deleteLibrary + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.DeleteLibraryBadRequest; + import dev.plexapi.plexapi.models.errors.DeleteLibraryUnauthorized; + import dev.plexapi.plexapi.models.operations.DeleteLibraryResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + DeleteLibraryResponse res = sdk.library().deleteLibrary() + .sectionKey(9518) + .call(); + // handle response } } @@ -6460,6 +8034,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -6467,6 +8042,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -6483,6 +8059,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -6490,10 +8067,11 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php - label: getWatchlist + label: list source: |- declare(strict_types=1); @@ -6503,26 +8081,26 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $request = new Operations\GetWatchlistRequest( - filter: Operations\PathParamFilter::Released, - sort: '', - libtype: Operations\Libtype::Movie, - maxresults: 303056, - includeCollections: Operations\IncludeCollections::Zero, - includeExternalMedia: Operations\IncludeExternalMedia::One, - xPlexToken: '', - xPlexContainerStart: 406911, - xPlexContainerSize: 958629, + $request = new Operations\GetWatchListRequest( + filter: Operations\Filter::Available, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + xPlexToken: 'CV5xoxjTpFKUzBTShsaf', ); - $response = $sdk->watchlist->getWatchlist($request); + $response = $sdk->watchlist->getWatchList($request); if ($response->object !== null) { // handle response @@ -6532,7 +8110,7 @@ paths: } - lang: ruby label: list - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetWatchListRequest.new(\n filter: ::PlexRubySDK::Operations::Filter::AVAILABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.watchlist.get_watch_list(req)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetWatchListRequest.new(\n filter: ::PlexRubySDK::Operations::Filter::AVAILABLE,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.watchlist.get_watch_list(req)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: list source: |- @@ -6548,7 +8126,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -6566,56 +8148,45 @@ paths: } } - lang: java - label: getWatchlist + label: list source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetWatchListBadRequest; + import dev.plexapi.plexapi.models.errors.GetWatchListUnauthorized; + import dev.plexapi.plexapi.models.operations.Filter; + import dev.plexapi.plexapi.models.operations.GetWatchListRequest; + import dev.plexapi.plexapi.models.operations.GetWatchListResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") - .xPlexClientIdentifier("Postman") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetWatchListRequest req = GetWatchListRequest.builder() + .filter(Filter.AVAILABLE) + .xPlexToken("CV5xoxjTpFKUzBTShsaf") + .xPlexContainerStart(0) + .xPlexContainerSize(50) .build(); - GetWatchlistRequest req = GetWatchlistRequest.builder() - .filter(PathParamFilter.RELEASED) - .xPlexToken("") - .build(); - - GetWatchlistResponse res = sdk.watchlist().getWatchlist() + GetWatchListResponse res = sdk.watchlist().getWatchList() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -6689,22 +8260,15 @@ paths: Adds the Guids object to the response schema: type: integer + format: int32 enum: - 0 - 1 - example: 1 - required: false - - name: includeMeta - in: query - description: | - Adds the Meta object to the response - schema: - type: integer - enum: - - 0 - - 1 - example: 1 - required: false + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE - name: type in: query description: | @@ -6714,6 +8278,7 @@ paths: 3 = season 4 = episode E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + required: false schema: type: integer enum: @@ -6722,7 +8287,26 @@ paths: - 3 - 4 example: 2 - required: true + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE + - name: includeMeta + in: query + description: | + Adds the Meta object to the response + schema: + type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE - name: X-Plex-Container-Start in: query description: | @@ -6765,352 +8349,1105 @@ paths: type: object properties: MediaContainer: - type: object - properties: - size: - type: integer - format: int32 - example: 70 - allowSync: - type: boolean - example: true - art: - type: string - example: '/:/resources/movie-fanart.jpg' - identifier: - type: string - example: com.plexapp.plugins.library - librarySectionID: - type: - - integer - - string - examples: - - 1 - - watchlist - librarySectionTitle: - type: string - example: Movies - librarySectionUUID: - type: string - example: 322a231a-b7f7-49f5-920f-14c61199cd30 - mediaTagPrefix: - type: string - example: /system/bundle/media/flags/ - mediaTagVersion: - type: integer - format: int32 - example: 1701731894 - thumb: - type: string - example: '/:/resources/movie.png' - title1: - type: string - example: Movies - title2: - type: string - example: Recently Released - viewGroup: - type: string - example: movie - viewMode: - type: integer - format: int32 - example: 65592 - mixedParents: - type: boolean - example: true - Metadata: - type: array - items: - type: object - properties: - ratingKey: - type: string - example: '58683' - key: - type: string - example: /library/metadata/58683 - guid: - type: string - example: 'plex://movie/5d7768ba96b655001fdc0408' - studio: - type: string - example: 20th Century Studios - type: - type: string - example: movie - title: - type: string - example: 'Avatar: The Way of Water' - contentRating: - type: string - example: PG-13 - summary: - type: string - example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.' - rating: - type: number - example: 7.6 - audienceRating: - type: number - example: 9.2 - year: - type: integer - format: int32 - example: 2022 - tagline: - type: string - example: Return to Pandora. - thumb: - type: string - example: /library/metadata/58683/thumb/1703239236 - art: - type: string - example: /library/metadata/58683/art/1703239236 - duration: - type: integer - format: int32 - example: 11558112 - originallyAvailableAt: - type: string - format: date - example: 2022-12-14T00:00:00.000Z - addedAt: - type: integer - format: int32 - example: 1680457607 - updatedAt: - type: integer - format: int32 - example: 1703239236 - audienceRatingImage: - type: string - example: 'rottentomatoes://image.rating.upright' - chapterSource: - type: string - example: media - primaryExtraKey: - type: string - example: /library/metadata/58684 - ratingImage: - type: string - example: 'rottentomatoes://image.rating.ripe' - grandparentRatingKey: - type: string - example: '66' - grandparentGuid: - type: string - example: 'plex://show/5d9c081b170e24001f2a7be4' - grandparentKey: - type: string - example: /library/metadata/66 - grandparentTitle: - type: string - example: Caprica - grandparentThumb: - type: string - example: /library/metadata/66/thumb/1705716261 - grandparentArt: - type: string - example: /library/metadata/66/art/1705716261 - grandparentTheme: - type: string - example: /library/metadata/66/theme/1705716261 - Media: - type: array - items: - type: object - properties: - id: - type: integer - format: int32 - example: 119534 - duration: - type: integer - format: int32 - example: 11558112 - bitrate: - type: integer - format: int32 - example: 25025 - width: - type: integer - format: int32 - example: 3840 - height: - type: integer - format: int32 - example: 2072 - aspectRatio: - type: number - example: 1.85 - audioChannels: - type: integer - format: int32 - example: 6 - audioCodec: - type: string - example: eac3 - videoCodec: - type: string - example: hevc - videoResolution: - type: string - example: 4k - container: - type: string - example: mkv - videoFrameRate: - type: string - example: 24p - videoProfile: - type: string - example: main 10 - Part: - type: array - items: - type: object - properties: - id: - type: integer - format: int32 - example: 119542 - key: - type: string - example: /library/parts/119542/1680457526/file.mkv - duration: - type: integer - format: int32 - example: 11558112 - file: - type: string - example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv - size: - type: integer - format: int64 - example: 36158371307 - container: - type: string - example: mkv - videoProfile: - type: string - example: main 10 - Genre: - type: array - items: - type: object - properties: - tag: - type: string - example: Adventure - Country: - type: array - items: - type: object - properties: - tag: - type: string - example: United States of America - Director: - type: array - items: - type: object - properties: - tag: - type: string - example: James Cameron - Writer: - type: array - items: - type: object - properties: - tag: - type: string - example: James Cameron - Role: - type: array - items: - type: object - properties: - tag: - type: string - example: Sigourney Weaver - titleSort: - type: string - example: Whale - viewCount: - type: integer - format: int32 - example: 1 - lastViewedAt: - type: integer - format: int32 - example: 1682752242 - originalTitle: - type: string - example: 映画 ブラッククローバー 魔法帝の剣 - viewOffset: - type: integer - format: int32 - example: 5222500 - skipCount: - type: integer - format: int32 - example: 1 - index: - type: integer - format: int32 - example: 1 - theme: - type: string - example: /library/metadata/1/theme/1705636920 - leafCount: - type: integer - format: int32 - example: 14 - viewedLeafCount: - type: integer - format: int32 - example: 0 - childCount: - type: integer - format: int32 - example: 1 - hasPremiumExtras: - type: string - example: '1' - hasPremiumPrimaryExtra: - type: string - example: '1' - parentRatingKey: - type: string - example: '66' - parentGuid: - type: string - example: 'plex://show/5d9c081b170e24001f2a7be4' - parentStudio: - type: string - example: UCP - parentKey: - type: string - example: /library/metadata/66 - parentTitle: - type: string - example: Caprica - parentIndex: - type: integer - format: int32 - example: 1 - parentYear: - type: integer - format: int32 - example: 2010 - parentThumb: - type: string - example: /library/metadata/66/thumb/1705716261 - parentTheme: - type: string - example: /library/metadata/66/theme/1705716261 + allOf: + - type: object + description: | + The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + properties: + Type: + type: array + items: + type: object + required: + - key + - type + - title + - active + properties: + key: + type: string + example: /library/sections/2/all?type=2 + type: + type: string + example: show + title: + type: string + example: TV Shows + active: + type: boolean + example: false + Filter: + type: array + items: + type: object + required: + - filter + - filterType + - key + - title + - type + properties: + filter: + type: string + example: genre + filterType: + type: string + example: string + key: + type: string + example: /library/sections/2/genre?type=2 + title: + type: string + example: Genre + type: + type: string + example: filter + Sort: + type: array + items: + type: object + required: + - key + - title + - defaultDirection + properties: + default: + type: string + example: asc + active: + type: boolean + example: false + activeDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + defaultDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + descKey: + type: string + example: 'titleSort:desc' + firstCharacterKey: + type: string + example: /library/sections/2/firstCharacter + key: + type: string + example: titleSort + title: + type: string + example: Title + Field: + type: array + items: + type: object + required: + - key + - title + - type + properties: + key: + type: string + example: show.title + title: + type: string + example: Show Title + type: + type: string + example: string + subType: + type: string + example: rating + FieldType: + type: array + items: + type: object + required: + - type + - Operator + properties: + type: + type: string + example: tag + Operator: + type: array + items: + type: object + required: + - key + - title + properties: + key: + type: string + example: '=' + title: + type: string + example: is + - type: object + required: + - size + - totalSize + - offset + - content + - allowSync + - art + - content + - identifier + - librarySectionID + - librarySectionTitle + - librarySectionUUID + - mediaTagPrefix + - mediaTagVersion + - thumb + - title1 + - title2 + - viewGroup + - Metadata + properties: + size: + type: integer + format: int32 + example: 70 + totalSize: + type: integer + format: int32 + example: 170 + offset: + type: integer + format: int32 + example: 0 + content: + type: string + example: secondary + allowSync: + type: boolean + example: true + nocache: + type: boolean + example: true + art: + type: string + example: '/:/resources/movie-fanart.jpg' + identifier: + type: string + example: com.plexapp.plugins.library + librarySectionID: + type: integer + examples: + - 1 + librarySectionTitle: + type: string + example: Movies + librarySectionUUID: + type: string + example: 322a231a-b7f7-49f5-920f-14c61199cd30 + mediaTagPrefix: + type: string + example: /system/bundle/media/flags/ + mediaTagVersion: + type: integer + format: int32 + example: 1701731894 + thumb: + type: string + example: '/:/resources/movie.png' + title1: + type: string + example: Movies + title2: + type: string + example: Recently Released + viewGroup: + type: string + example: movie + viewMode: + type: integer + format: int32 + example: 65592 + mixedParents: + type: boolean + example: true + Metadata: + type: array + items: + type: object + required: + - ratingKey + - key + - guid + - title + - type + - addedAt + - summary + properties: + ratingKey: + type: string + example: '58683' + description: | + The rating key (Media ID) of this media item. + Note: This is always an integer, but is represented as a string in the API. + key: + type: string + example: /library/metadata/58683 + guid: + type: string + example: 'plex://movie/5d7768ba96b655001fdc0408' + studio: + type: string + example: 20th Century Studios + skipChildren: + type: boolean + example: false + librarySectionID: + type: integer + examples: + - 1 + librarySectionTitle: + type: string + example: Movies + librarySectionKey: + type: string + example: /library/sections/1 + type: + type: string + enum: + - movie + - show + - season + - episode + example: movie + description: | + The type of media content + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE + title: + type: string + example: 'Avatar: The Way of Water' + slug: + type: string + example: 4-for-texas + contentRating: + type: string + example: PG-13 + summary: + type: string + example: 'Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na''vi race to protect their home.' + rating: + type: number + example: 7.6 + audienceRating: + type: number + example: 9.2 + year: + type: integer + format: int32 + example: 2022 + seasonCount: + type: integer + format: int32 + example: 2022 + tagline: + type: string + example: Return to Pandora. + flattenSeasons: + type: string + enum: + - '0' + - '1' + example: '1' + default: '0' + x-speakeasy-enums: + - false + - true + showOrdering: + type: string + description: "Setting that indicates the episode ordering for the show \nNone = Library default, \ntmdbAiring = The Movie Database (Aired), \naired = TheTVDB (Aired), \ndvd = TheTVDB (DVD), \nabsolute = TheTVDB (Absolute)).\n" + enum: + - None + - tmdbAiring + - aired + - dvd + - absolute + x-speakeasy-enums: + - NONE + - TMDB_AIRING + - AIRED + - DVD + - ABSOLUTE + example: dvd + thumb: + type: string + example: /library/metadata/58683/thumb/1703239236 + art: + type: string + example: /library/metadata/58683/art/1703239236 + banner: + type: string + example: /library/metadata/58683/banner/1703239236 + duration: + type: integer + format: int32 + example: 11558112 + originallyAvailableAt: + type: string + format: date + example: 2022-12-14T00:00:00.000Z + addedAt: + type: + - integer + example: 1556281940 + description: Unix epoch datetime in seconds + format: int64 + updatedAt: + type: + - integer + example: 1556281940 + description: Unix epoch datetime in seconds + format: int64 + audienceRatingImage: + type: string + example: 'rottentomatoes://image.rating.upright' + chapterSource: + type: string + example: media + primaryExtraKey: + type: string + example: /library/metadata/58684 + ratingImage: + type: string + example: 'rottentomatoes://image.rating.ripe' + grandparentRatingKey: + type: string + example: '66' + grandparentGuid: + type: string + example: 'plex://show/5d9c081b170e24001f2a7be4' + grandparentKey: + type: string + example: /library/metadata/66 + grandparentTitle: + type: string + example: Caprica + grandparentThumb: + type: string + example: /library/metadata/66/thumb/1705716261 + parentSlug: + type: string + example: alice-in-borderland-2020 + grandparentSlug: + type: string + example: alice-in-borderland-2020 + grandparentArt: + type: string + example: /library/metadata/66/art/1705716261 + grandparentTheme: + type: string + example: /library/metadata/66/theme/1705716261 + Media: + description: | + The Media object is only included when type query is `4` or higher. + type: array + items: + type: object + required: + - id + - duration + - bitrate + - width + - height + - aspectRatio + - audioChannels + - audioCodec + - videoCodec + - videoResolution + - container + - videoFrameRate + - videoProfile + - Part + properties: + id: + type: integer + format: int32 + example: 119534 + duration: + type: integer + format: int32 + example: 11558112 + bitrate: + type: integer + format: int32 + example: 25025 + width: + type: integer + format: int32 + example: 3840 + height: + type: integer + format: int32 + example: 2072 + aspectRatio: + type: number + example: 1.85 + audioProfile: + type: string + example: dts + audioChannels: + type: integer + format: int32 + example: 6 + audioCodec: + type: string + example: eac3 + videoCodec: + type: string + example: hevc + videoResolution: + type: string + example: 4k + container: + type: string + example: mkv + videoFrameRate: + type: string + example: 24p + videoProfile: + type: string + example: main 10 + hasVoiceActivity: + type: boolean + example: false + optimizedForStreaming: + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + has64bitOffsets: + type: boolean + example: false + Part: + type: array + items: + type: object + required: + - id + - key + - duration + - file + - size + - container + - videoProfile + properties: + id: + type: integer + format: int32 + example: 119542 + key: + type: string + example: /library/parts/119542/1680457526/file.mkv + duration: + type: integer + format: int32 + example: 11558112 + file: + type: string + example: /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv + size: + type: integer + format: int64 + example: 36158371307 + container: + type: string + description: | + The container format of the media file. + example: mkv + audioProfile: + type: string + example: dts + has64bitOffsets: + type: boolean + example: false + optimizedForStreaming: + type: boolean + example: false + videoProfile: + type: string + example: main 10 + indexes: + type: string + example: sd + hasThumbnail: + type: string + enum: + - '0' + - '1' + example: '1' + default: '0' + x-speakeasy-enums: + - false + - true + Stream: + type: array + items: + type: object + required: + - id + - streamType + - codec + - index + properties: + id: + type: integer + example: 272796 + streamType: + type: integer + description: 'Type of stream (1 = video, 2 = audio, 3 = subtitle)' + example: 1 + default: + type: boolean + description: Indicates if this is the default stream + example: true + selected: + type: boolean + description: Indicates if the stream is selected + example: true + codec: + type: string + description: Codec used by the stream + example: h264 + index: + type: integer + description: The index of the stream + example: 0 + bitrate: + type: integer + description: The bitrate of the stream in kbps + example: 6273 + colorPrimaries: + type: string + description: The color primaries of the video stream + example: bt709 + colorRange: + type: string + description: The color range of the video stream + example: tv + colorSpace: + type: string + description: The color space of the video stream + example: bt709 + colorTrc: + type: string + description: The transfer characteristics (TRC) of the video stream + example: bt709 + bitDepth: + type: integer + description: The bit depth of the video stream + example: 8 + chromaLocation: + type: string + description: The chroma location of the video stream + example: left + streamIdentifier: + type: string + description: The identifier of the video stream + example: '2' + chromaSubsampling: + type: string + description: The chroma subsampling format + example: '4:2:0' + codedHeight: + type: integer + description: The coded height of the video stream + example: 1088 + codedWidth: + type: integer + description: The coded width of the video stream + example: 1920 + frameRate: + type: number + description: The frame rate of the video stream + example: 29.97 + hasScalingMatrix: + type: boolean + description: Indicates if the stream has a scaling matrix + example: false + hearingImpaired: + type: boolean + example: false + closedCaptions: + type: boolean + example: false + embeddedInVideo: + type: string + example: '1' + height: + type: integer + description: The height of the video stream + example: 1080 + level: + type: integer + description: The level of the video codec + example: 40 + profile: + type: string + description: The profile of the video codec + example: main + refFrames: + type: integer + description: Number of reference frames + example: 4 + scanType: + type: string + description: The scan type (progressive or interlaced) + example: progressive + width: + type: integer + description: The width of the video stream + example: 1920 + displayTitle: + type: string + description: Display title of the stream + example: 1080p (H.264) + extendedDisplayTitle: + type: string + description: Extended display title of the stream + example: 1080p (H.264) + channels: + type: integer + description: Number of audio channels (for audio streams) + example: 2 + language: + type: string + description: The language of the stream (for audio/subtitle streams) + example: English + languageTag: + type: string + description: Language tag of the stream + example: en + languageCode: + type: string + description: Language code of the stream + example: eng + audioChannelLayout: + type: string + description: The audio channel layout + example: stereo + samplingRate: + type: integer + description: Sampling rate of the audio stream in Hz + example: 48000 + title: + type: string + description: Title of the subtitle track (for subtitle streams) + example: English + canAutoSync: + type: boolean + description: Indicates if the subtitle stream can auto-sync + example: false + Genre: + type: array + items: + type: object + properties: + tag: + type: string + example: Adventure + Country: + type: array + items: + type: object + properties: + tag: + type: string + example: United States of America + Director: + type: array + items: + type: object + properties: + tag: + type: string + example: James Cameron + Writer: + type: array + items: + type: object + properties: + tag: + type: string + example: James Cameron + Collection: + type: array + items: + type: object + properties: + tag: + type: string + example: Working NL Subs + Role: + type: array + items: + type: object + properties: + id: + type: integer + description: The ID of the tag or actor. + example: 294129 + filter: + type: string + description: The filter used to find the actor or tag. + example: actor=294129 + thumb: + type: string + description: The thumbnail of the actor + example: 'https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg' + tag: + type: string + description: The name of the tag or actor. + example: Mike Smith + tagKey: + type: string + description: Unique identifier for the tag. + example: 668e7e7b22bcad9064350c91 + role: + type: string + description: The role of the actor or tag in the media. + example: Self + Guid: + x-speakeasy-name-override: MediaGuid + description: | + The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: | + Can be one of the following formats: + imdb://tt13015952, tmdb://2434012, tvdb://7945991 + example: 'imdb://tt13015952' + UltraBlurColors: + type: object + required: + - topLeft + - topRight + - bottomRight + - bottomLeft + properties: + topLeft: + type: string + example: 11333b + topRight: + type: string + example: 0a232d + bottomRight: + type: string + example: 073958 + bottomLeft: + type: string + example: 1f5066 + Rating: + x-speakeasy-name-override: MetaDataRating + type: array + items: + type: object + required: + - image + - value + - type + properties: + image: + type: string + description: A URI or path to the rating image. + example: 'themoviedb://image.rating' + value: + type: number + format: float + description: The value of the rating. + example: 3 + type: + type: string + description: 'The type of rating (e.g., audience, critic).' + example: audience + Image: + type: array + items: + type: object + required: + - alt + - type + - url + properties: + alt: + type: string + example: Episode 1 + type: + type: string + enum: + - coverPoster + - background + - snapshot + - clearLogo + example: background + url: + type: string + example: /library/metadata/45521/thumb/1644710589 + titleSort: + type: string + example: Whale + viewCount: + type: integer + format: int32 + example: 1 + lastViewedAt: + type: integer + format: int32 + example: 1682752242 + originalTitle: + type: string + example: 映画 ブラッククローバー 魔法帝の剣 + viewOffset: + type: integer + format: int32 + example: 5222500 + skipCount: + type: integer + format: int32 + example: 1 + index: + type: integer + format: int32 + example: 1 + theme: + type: string + example: /library/metadata/1/theme/1705636920 + leafCount: + type: integer + format: int32 + example: 14 + viewedLeafCount: + type: integer + format: int32 + example: 0 + childCount: + type: integer + format: int32 + example: 1 + hasPremiumExtras: + type: string + example: '1' + hasPremiumPrimaryExtra: + type: string + example: '1' + parentRatingKey: + type: string + description: | + The rating key of the parent item. + example: '66' + parentGuid: + type: string + example: 'plex://show/5d9c081b170e24001f2a7be4' + parentStudio: + type: string + example: UCP + parentKey: + type: string + example: /library/metadata/66 + parentTitle: + type: string + example: Caprica + parentIndex: + type: integer + format: int32 + example: 1 + parentYear: + type: integer + format: int32 + example: 2010 + parentThumb: + type: string + example: /library/metadata/66/thumb/1705716261 + parentTheme: + type: string + example: /library/metadata/66/theme/1705716261 + Meta: + description: | + The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + type: object + properties: + Type: + type: array + items: + type: object + required: + - key + - type + - title + - active + properties: + key: + type: string + example: /library/sections/2/all?type=2 + type: + type: string + example: show + title: + type: string + example: TV Shows + active: + type: boolean + example: false + Filter: + type: array + items: + type: object + required: + - filter + - filterType + - key + - title + - type + properties: + filter: + type: string + example: genre + filterType: + type: string + example: string + key: + type: string + example: /library/sections/2/genre?type=2 + title: + type: string + example: Genre + type: + type: string + example: filter + Sort: + type: array + items: + type: object + required: + - key + - title + - defaultDirection + properties: + default: + type: string + example: asc + active: + type: boolean + example: false + activeDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + defaultDirection: + type: string + enum: + - asc + - desc + example: asc + default: asc + description: | + The direction of the sort. Can be either `asc` or `desc`. + x-speakeasy-enums: + - ASCENDING + - DESCENDING + descKey: + type: string + example: 'titleSort:desc' + firstCharacterKey: + type: string + example: /library/sections/2/firstCharacter + key: + type: string + example: titleSort + title: + type: string + example: Title + Field: + type: array + items: + type: object + required: + - key + - title + - type + properties: + key: + type: string + example: show.title + title: + type: string + example: Show Title + type: + type: string + example: string + subType: + type: string + example: rating + FieldType: + type: array + items: + type: object + required: + - type + - Operator + properties: + type: + type: string + example: tag + Operator: + type: array + items: + type: object + required: + - key + - title + properties: + key: + type: string + example: '=' + title: + type: string + example: is '400': description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' content: @@ -7126,6 +9463,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -7133,6 +9471,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7149,6 +9488,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -7156,11 +9496,53 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: items + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $request = new Operations\GetLibraryItemsRequest( + sectionKey: 9518, + tag: Operations\Tag::Edition, + includeGuids: Operations\IncludeGuids::Enable, + includeMeta: Operations\IncludeMeta::Enable, + type: Operations\Type::TvShow, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + ); + $response = $sdk->library->getLibraryItems($request); + + if ($response->object !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: items - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetLibraryItemsRequest.new(\n section_key: 9518,\n tag: ::PlexRubySDK::Operations::Tag::EDITION,\n include_guids: ::PlexRubySDK::Operations::IncludeGuids::ONE,\n include_meta: ::PlexRubySDK::Operations::IncludeMeta::ONE,\n type: ::PlexRubySDK::Operations::Type::TWO,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.library.get_library_items(req)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetLibraryItemsRequest.new(\n section_key: 9518,\n tag: ::PlexRubySDK::Operations::Tag::EDITION,\n include_guids: ::PlexRubySDK::Operations::IncludeGuids::ENABLE,\n include_meta: ::PlexRubySDK::Operations::IncludeMeta::ENABLE,\n type: ::PlexRubySDK::Operations::Type::TV_SHOW,\n x_plex_container_start: 0,\n x_plex_container_size: 50,\n)\n \nres = s.library.get_library_items(req)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: items source: |- @@ -7176,16 +9558,20 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{ SectionKey: 9518, Tag: operations.TagEdition, - IncludeGuids: operations.IncludeGuidsOne.ToPointer(), - IncludeMeta: operations.IncludeMetaOne.ToPointer(), - Type: operations.TypeTwo, + IncludeGuids: operations.IncludeGuidsEnable.ToPointer(), + IncludeMeta: operations.IncludeMetaEnable.ToPointer(), + Type: operations.TypeTvShow.ToPointer(), XPlexContainerStart: plexgo.Int(0), XPlexContainerSize: plexgo.Int(50), }) @@ -7196,6 +9582,54 @@ paths: // handle response } } + - lang: java + label: items + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetLibraryItemsBadRequest; + import dev.plexapi.plexapi.models.errors.GetLibraryItemsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetLibraryItemsRequest; + import dev.plexapi.plexapi.models.operations.GetLibraryItemsResponse; + import dev.plexapi.plexapi.models.operations.IncludeGuids; + import dev.plexapi.plexapi.models.operations.IncludeMeta; + import dev.plexapi.plexapi.models.operations.Tag; + import dev.plexapi.plexapi.models.operations.Type; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() + .sectionKey(9518) + .tag(Tag.EDITION) + .includeGuids(IncludeGuids.Enable) + .includeMeta(IncludeMeta.Enable) + .type(Type.TvShow) + .xPlexContainerStart(0) + .xPlexContainerSize(50) + .build(); + + GetLibraryItemsResponse res = sdk.library().getLibraryItems() + .request(req) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } + } - lang: typescript label: items source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { IncludeGuids, IncludeMeta, Tag, Type } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryItems({\n sectionKey: 9518,\n tag: Tag.Edition,\n includeGuids: IncludeGuids.One,\n includeMeta: IncludeMeta.One,\n type: Type.Two,\n xPlexContainerStart: 0,\n xPlexContainerSize: 50,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -7244,6 +9678,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -7251,6 +9686,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7267,6 +9703,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -7274,11 +9711,45 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: metadata + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->library->getRefreshLibraryMetadata(9518, Operations\Force::One); + + if ($response->statusCode === 200) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: metadata - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_refresh_library_metadata(section_key=9518, force=::PlexRubySDK::Operations::Force::ONE)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_refresh_library_metadata(section_key=9518, force=::PlexRubySDK::Operations::Force::ONE)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: metadata source: |- @@ -7294,7 +9765,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -7303,6 +9778,39 @@ paths: log.Fatal(err) } if res != nil { + // handle response + } + } + - lang: java + label: metadata + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataBadRequest; + import dev.plexapi.plexapi.models.errors.GetRefreshLibraryMetadataUnauthorized; + import dev.plexapi.plexapi.models.operations.Force; + import dev.plexapi.plexapi.models.operations.GetRefreshLibraryMetadataResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() + .sectionKey(9518) + .force(Force.ONE) + .call(); + // handle response } } @@ -7351,6 +9859,11 @@ paths: - 3 - 4 example: 2 + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE required: true responses: '200': @@ -7487,6 +10000,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -7494,6 +10008,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -7510,6 +10025,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -7517,11 +10033,45 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: library + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->library->getSearchLibrary(9518, Operations\QueryParamType::TvShow); + + if ($response->object !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: library - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_search_library(section_key=9518, type=::PlexRubySDK::Operations::QueryParamType::TWO)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_search_library(section_key=9518, type=::PlexRubySDK::Operations::QueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: library source: |- @@ -7537,11 +10087,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.QueryParamTypeTwo) + res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.QueryParamTypeTvShow) if err != nil { log.Fatal(err) } @@ -7549,6 +10103,41 @@ paths: // handle response } } + - lang: java + label: library + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSearchLibraryBadRequest; + import dev.plexapi.plexapi.models.errors.GetSearchLibraryUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSearchLibraryResponse; + import dev.plexapi.plexapi.models.operations.QueryParamType; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetSearchLibraryResponse res = sdk.library().getSearchLibrary() + .sectionKey(9518) + .type(QueryParamType.TvShow) + .call(); + + if (res.object().isPresent()) { + // handle response + } + } + } - lang: typescript label: library source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { QueryParamType } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getSearchLibrary(9518, QueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -8058,6 +10647,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -8065,6 +10655,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -8081,6 +10672,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -8088,10 +10680,11 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php - label: getMetadata + label: key source: |- declare(strict_types=1); @@ -8100,16 +10693,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->library->getMetadata(8382.31); + $response = $sdk->library->getMetaDataByRatingKey(9518); if ($response->object !== null) { // handle response @@ -8119,7 +10717,7 @@ paths: } - lang: ruby label: key - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_meta_data_by_rating_key(rating_key=9518)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_meta_data_by_rating_key(rating_key=9518)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: key source: |- @@ -8134,7 +10732,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -8147,51 +10749,36 @@ paths: } } - lang: java - label: getMetadata + label: key source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyBadRequest; + import dev.plexapi.plexapi.models.errors.GetMetaDataByRatingKeyUnauthorized; + import dev.plexapi.plexapi.models.operations.GetMetaDataByRatingKeyResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetMetaDataByRatingKeyBadRequest, GetMetaDataByRatingKeyUnauthorized, Exception { - GetMetadataResponse res = sdk.library().getMetadata() - .ratingKey(8382.31d) + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetMetaDataByRatingKeyResponse res = sdk.library().getMetaDataByRatingKey() + .ratingKey(9518L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -8321,6 +10908,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -8328,6 +10916,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -8344,6 +10933,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -8351,11 +10941,52 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: image + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $request = new Operations\GetBannerImageRequest( + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: 'CV5xoxjTpFKUzBTShsaf', + ); + $response = $sdk->media->getBannerImage($request); + + if ($response->bytes !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: image - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetBannerImageRequest.new(\n rating_key: 9518,\n width: 396,\n height: 396,\n min_size: 1,\n upscale: 1,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.media.get_banner_image(req)\n\nif ! res.bytes.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetBannerImageRequest.new(\n rating_key: 9518,\n width: 396,\n height: 396,\n min_size: 1,\n upscale: 1,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.media.get_banner_image(req)\n\nif ! res.bytes.nil?\n # handle response\nend" - lang: go label: image source: |- @@ -8371,7 +11002,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -8390,6 +11025,49 @@ paths: // handle response } } + - lang: java + label: image + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetBannerImageBadRequest; + import dev.plexapi.plexapi.models.errors.GetBannerImageUnauthorized; + import dev.plexapi.plexapi.models.operations.GetBannerImageRequest; + import dev.plexapi.plexapi.models.operations.GetBannerImageResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetBannerImageRequest req = GetBannerImageRequest.builder() + .ratingKey(9518L) + .width(396L) + .height(396L) + .minSize(1L) + .upscale(1L) + .xPlexToken("CV5xoxjTpFKUzBTShsaf") + .build(); + + GetBannerImageResponse res = sdk.media().getBannerImage() + .request(req) + .call(); + + if (res.responseStream().isPresent()) { + // handle response + } + } + } - lang: typescript label: image source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getBannerImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -8517,6 +11195,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -8524,6 +11203,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -8540,6 +11220,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -8547,11 +11228,52 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: image + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $request = new Operations\GetThumbImageRequest( + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: 'CV5xoxjTpFKUzBTShsaf', + ); + $response = $sdk->media->getThumbImage($request); + + if ($response->bytes !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: image - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetThumbImageRequest.new(\n rating_key: 9518,\n width: 396,\n height: 396,\n min_size: 1,\n upscale: 1,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.media.get_thumb_image(req)\n\nif ! res.bytes.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetThumbImageRequest.new(\n rating_key: 9518,\n width: 396,\n height: 396,\n min_size: 1,\n upscale: 1,\n x_plex_token: \"CV5xoxjTpFKUzBTShsaf\",\n)\n \nres = s.media.get_thumb_image(req)\n\nif ! res.bytes.nil?\n # handle response\nend" - lang: go label: image source: |- @@ -8567,7 +11289,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -8586,6 +11312,49 @@ paths: // handle response } } + - lang: java + label: image + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetThumbImageBadRequest; + import dev.plexapi.plexapi.models.errors.GetThumbImageUnauthorized; + import dev.plexapi.plexapi.models.operations.GetThumbImageRequest; + import dev.plexapi.plexapi.models.operations.GetThumbImageResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetThumbImageRequest req = GetThumbImageRequest.builder() + .ratingKey(9518L) + .width(396L) + .height(396L) + .minSize(1L) + .upscale(1L) + .xPlexToken("CV5xoxjTpFKUzBTShsaf") + .build(); + + GetThumbImageResponse res = sdk.media().getThumbImage() + .request(req) + .call(); + + if (res.responseStream().isPresent()) { + // handle response + } + } + } - lang: typescript label: image source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getThumbImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -8839,6 +11608,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -8846,6 +11616,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -8862,6 +11633,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -8869,6 +11641,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -8881,16 +11654,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->library->getMetadataChildren(1539.14, ''); + $response = $sdk->library->getMetadataChildren(1539.15, ''); if ($response->object !== null) { // handle response @@ -8900,7 +11678,7 @@ paths: } - lang: ruby label: getMetadataChildren - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_metadata_children(rating_key=1539.14, include_elements=\"\")\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_metadata_children(rating_key=1539.15, include_elements=\"\")\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getMetadataChildren source: |- @@ -8915,11 +11693,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Library.GetMetadataChildren(ctx, 1539.14, plexgo.String("Stream")) + res, err := s.Library.GetMetadataChildren(ctx, 1539.15, plexgo.String("Stream")) if err != nil { log.Fatal(err) } @@ -8932,48 +11714,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetMetadataChildrenBadRequest; + import dev.plexapi.plexapi.models.errors.GetMetadataChildrenUnauthorized; + import dev.plexapi.plexapi.models.operations.GetMetadataChildrenResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception { - GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() - .ratingKey(1539.14d) + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() + .ratingKey(1539.15d) .includeElements("") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetMetadataChildrenResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -9005,6 +11772,11 @@ paths: - 3 - 4 example: 2 + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE required: true - name: includeGuids in: query @@ -9221,6 +11993,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -9228,6 +12001,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -9244,6 +12018,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -9251,6 +12026,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -9262,17 +12038,23 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->library->getTopWatchedContent(505531, 1); + $response = $sdk->library->getTopWatchedContent(Operations\GetTopWatchedContentQueryParamType::TvShow, 1); if ($response->object !== null) { // handle response @@ -9282,7 +12064,7 @@ paths: } - lang: ruby label: getTopWatchedContent - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_top_watched_content(type=::PlexRubySDK::Operations::GetTopWatchedContentQueryParamType::TWO, include_guids=1)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_top_watched_content(type=::PlexRubySDK::Operations::GetTopWatchedContentQueryParamType::TV_SHOW, include_guids=1)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getTopWatchedContent source: |- @@ -9298,11 +12080,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeTwo, plexgo.Int64(1)) + res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeTvShow, plexgo.Int64(1)) if err != nil { log.Fatal(err) } @@ -9315,45 +12101,34 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTopWatchedContentBadRequest; + import dev.plexapi.plexapi.models.errors.GetTopWatchedContentUnauthorized; + import dev.plexapi.plexapi.models.operations.GetTopWatchedContentQueryParamType; + import dev.plexapi.plexapi.models.operations.GetTopWatchedContentResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception { - GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() - .type(505531L) + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() + .type(GetTopWatchedContentQueryParamType.TvShow) .includeGuids(1L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -9674,6 +12449,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -9681,6 +12457,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -9697,6 +12474,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -9704,6 +12482,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -9716,11 +12495,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -9734,7 +12518,7 @@ paths: } - lang: ruby label: getOnDeck - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_on_deck()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_on_deck()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getOnDeck source: |- @@ -9749,7 +12533,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -9766,46 +12554,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetOnDeckBadRequest; + import dev.plexapi.plexapi.models.errors.GetOnDeckUnauthorized; + import dev.plexapi.plexapi.models.operations.GetOnDeckResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetOnDeckBadRequest, GetOnDeckUnauthorized, Exception { - GetOnDeckResponse res = sdk.library().getOnDeck() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetOnDeckResponse res = sdk.library().getOnDeck() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetOnDeckResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -9821,16 +12594,6 @@ paths: description: Get Plex server access tokens and server connections operationId: get-server-resources parameters: - - name: X-Plex-Client-Identifier - description: | - The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - in: query - schema: - type: string - example: gcgzw5rz2xovp84b4vha3a40 - required: true - name: includeHttps in: query description: Include Https entries in the results @@ -9842,6 +12605,9 @@ paths: - 1 example: 1 default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE - name: includeRelay in: query description: "Include Relay addresses in the results \nE.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400\n" @@ -9853,6 +12619,9 @@ paths: - 1 example: 1 default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE - name: includeIPv6 in: query description: Include IPv6 entries in the results @@ -9864,6 +12633,9 @@ paths: - 1 example: 1 default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE responses: '200': description: List of Plex Devices. This includes Plex hosted servers and clients @@ -9921,11 +12693,17 @@ paths: clientIdentifier: type: string createdAt: - type: string - format: date-time + allOf: + - type: string + format: date-time + example: '2019-06-24T11:38:02Z' + - description: The time the device was created/registered lastSeenAt: - type: string - format: date-time + allOf: + - type: string + format: date-time + example: '2019-06-24T11:38:02Z' + - description: The last time the device was seen provides: type: string ownerId: @@ -9973,18 +12751,29 @@ paths: - IPv6 properties: protocol: + description: 'The protocol used for the connection (http, https, etc)' type: string + enum: + - http + - https address: + description: The (ip) address or domain name used for the connection type: string port: - type: number + description: The port used for the connection + type: integer + format: int32 uri: + description: The full URI of the connection type: string local: + description: If the connection is local address type: boolean relay: + description: If the connection is relayed through plex.direct type: boolean IPv6: + description: If the connection is using IPv6 type: boolean '400': description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' @@ -10001,6 +12790,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10008,6 +12798,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10024,6 +12815,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10031,11 +12823,45 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: resources + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->plex->getServerResources(Operations\IncludeHttps::Enable, Operations\IncludeRelay::Enable, Operations\IncludeIPv6::Enable); + + if ($response->plexDevices !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: resources - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_server_resources(x_plex_client_identifier=\"gcgzw5rz2xovp84b4vha3a40\", include_https=::PlexRubySDK::Operations::IncludeHttps::ONE, include_relay=::PlexRubySDK::Operations::IncludeRelay::ONE, include_i_pv6=::PlexRubySDK::Operations::IncludeIPv6::ONE)\n\nif ! res.plex_devices.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.plex.get_server_resources(include_https=::PlexRubySDK::Operations::IncludeHttps::ENABLE, include_relay=::PlexRubySDK::Operations::IncludeRelay::ENABLE, include_i_pv6=::PlexRubySDK::Operations::IncludeIPv6::ENABLE)\n\nif ! res.plex_devices.nil?\n # handle response\nend" - lang: go label: resources source: |- @@ -10051,11 +12877,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Plex.GetServerResources(ctx, plexgo.String("gcgzw5rz2xovp84b4vha3a40"), operations.IncludeHTTPSOne.ToPointer(), operations.IncludeRelayOne.ToPointer(), operations.IncludeIPv6One.ToPointer()) + res, err := s.Plex.GetServerResources(ctx, operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer()) if err != nil { log.Fatal(err) } @@ -10063,6 +12893,44 @@ paths: // handle response } } + - lang: java + label: resources + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerResourcesBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerResourcesUnauthorized; + import dev.plexapi.plexapi.models.operations.GetServerResourcesResponse; + import dev.plexapi.plexapi.models.operations.IncludeHttps; + import dev.plexapi.plexapi.models.operations.IncludeIPv6; + import dev.plexapi.plexapi.models.operations.IncludeRelay; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerResourcesResponse res = sdk.plex().getServerResources() + .includeHttps(IncludeHttps.Enable) + .includeRelay(IncludeRelay.Enable) + .includeIPv6(IncludeIPv6.Enable) + .call(); + + if (res.plexDevices().isPresent()) { + // handle response + } + } + } - lang: typescript label: resources source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { IncludeHttps, IncludeIPv6, IncludeRelay } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getServerResources(\"gcgzw5rz2xovp84b4vha3a40\", IncludeHttps.One, IncludeRelay.One, IncludeIPv6.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -10119,6 +12987,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10126,6 +12995,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10142,6 +13012,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10149,6 +13020,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -10162,11 +13034,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -10181,7 +13058,7 @@ paths: } - lang: ruby label: logLine - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.log.log_line(level=::PlexRubySDK::Operations::Level::THREE, message=\"Test log message\", source=\"Postman\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.log.log_line(level=::PlexRubySDK::Operations::Level::THREE, message=\"Test log message\", source=\"Postman\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: logLine source: |- @@ -10197,7 +13074,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -10214,47 +13095,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.LogLineBadRequest; + import dev.plexapi.plexapi.models.errors.LogLineUnauthorized; + import dev.plexapi.plexapi.models.operations.Level; + import dev.plexapi.plexapi.models.operations.LogLineResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception { - LogLineResponse res = sdk.log().logLine() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + LogLineResponse res = sdk.log().logLine() .level(Level.THREE) .message("Test log message") .source("Postman") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.LogLineResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -10294,6 +13161,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10301,6 +13169,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10317,6 +13186,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10324,6 +13194,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -10336,11 +13207,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -10357,7 +13233,7 @@ paths: } - lang: ruby label: logMultiLine - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = \"level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman\"\n \nres = s.log.log_multi_line(req)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = \"level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman\"\n \nres = s.log.log_multi_line(req)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: logMultiLine source: |- @@ -10372,7 +13248,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -10391,49 +13271,34 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.LogMultiLineBadRequest; + import dev.plexapi.plexapi.models.errors.LogMultiLineUnauthorized; + import dev.plexapi.plexapi.models.operations.LogMultiLineResponse; + import java.lang.Exception; + import java.lang.String; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); - String req = "level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"; + String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman + level=1&message=Test%20message%203&source=postman"; - LogMultiLineResponse res = sdk.log().logMultiLine() + LogMultiLineResponse res = sdk.log().logMultiLine() .request(req) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.LogMultiLineResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -10465,6 +13330,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10472,6 +13338,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10488,6 +13355,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10495,6 +13363,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 '403': description: the user was not signed in @@ -10509,11 +13378,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -10527,7 +13401,7 @@ paths: } - lang: ruby label: enablePaperTrail - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.log.enable_paper_trail()\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.log.enable_paper_trail()\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: enablePaperTrail source: |- @@ -10542,7 +13416,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -10559,44 +13437,29 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.EnablePaperTrailBadRequest; + import dev.plexapi.plexapi.models.errors.EnablePaperTrailUnauthorized; + import dev.plexapi.plexapi.models.operations.EnablePaperTrailResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception { - EnablePaperTrailResponse res = sdk.log().enablePaperTrail() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + EnablePaperTrailResponse res = sdk.log().enablePaperTrail() .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.EnablePaperTrailResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -10669,6 +13532,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10676,6 +13540,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10692,6 +13557,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10699,6 +13565,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -10711,11 +13578,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -10729,7 +13601,7 @@ paths: } - lang: ruby label: getMyPlexAccount - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_my_plex_account()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_my_plex_account()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getMyPlexAccount source: |- @@ -10744,7 +13616,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -10761,46 +13637,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetMyPlexAccountBadRequest; + import dev.plexapi.plexapi.models.errors.GetMyPlexAccountUnauthorized; + import dev.plexapi.plexapi.models.operations.GetMyPlexAccountResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception { - GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetMyPlexAccountResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -10891,6 +13752,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -10898,6 +13760,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -10914,6 +13777,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -10921,6 +13785,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -10934,11 +13799,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -10947,7 +13817,7 @@ paths: height: 165, opacity: 643869, blur: 4000, - minSize: Operations\MinSize::Zero, + minSize: Operations\MinSize::One, upscale: Operations\Upscale::Zero, url: '/library/metadata/49564/thumb/1654258204', ); @@ -10961,7 +13831,7 @@ paths: } - lang: ruby label: getResizedPhoto - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetResizedPhotoRequest.new(\n width: 110.0,\n height: 165.0,\n opacity: 643869,\n blur: 0.0,\n min_size: ::PlexRubySDK::Operations::MinSize::ZERO,\n upscale: ::PlexRubySDK::Operations::Upscale::ONE,\n url: \"/library/metadata/49564/thumb/1654258204\",\n)\n \nres = s.server.get_resized_photo(req)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::GetResizedPhotoRequest.new(\n width: 110.0,\n height: 165.0,\n opacity: 643869,\n blur: 4000.0,\n min_size: ::PlexRubySDK::Operations::MinSize::ONE,\n upscale: ::PlexRubySDK::Operations::Upscale::ZERO,\n url: \"/library/metadata/49564/thumb/1654258204\",\n)\n \nres = s.server.get_resized_photo(req)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: getResizedPhoto source: |- @@ -10977,7 +13847,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -10985,7 +13859,7 @@ paths: Width: 110, Height: 165, Opacity: 100, - Blur: 20, + Blur: 0, MinSize: operations.MinSizeOne, Upscale: operations.UpscaleOne, URL: "/library/metadata/49564/thumb/1654258204", @@ -11002,55 +13876,43 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetResizedPhotoBadRequest; + import dev.plexapi.plexapi.models.errors.GetResizedPhotoUnauthorized; + import dev.plexapi.plexapi.models.operations.GetResizedPhotoRequest; + import dev.plexapi.plexapi.models.operations.GetResizedPhotoResponse; + import dev.plexapi.plexapi.models.operations.MinSize; + import dev.plexapi.plexapi.models.operations.Upscale; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception { - GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() .width(110d) .height(165d) - .opacity(643869L) - .blur(4000d) - .minSize(MinSize.ZERO) - .upscale(Upscale.ZERO) + .opacity(100L) + .blur(0d) + .minSize(MinSize.ONE) + .upscale(Upscale.ONE) .url("/library/metadata/49564/thumb/1654258204") .build(); - GetResizedPhotoResponse res = sdk.server().getResizedPhoto() + GetResizedPhotoResponse res = sdk.server().getResizedPhoto() .request(req) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.GetResizedPhotoResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -11064,7 +13926,7 @@ paths: - Plex summary: Get a Pin operationId: getPin - description: Retrieve a Pin from Plex.tv for authentication flows + description: Retrieve a Pin ID from Plex.tv to use for authentication flows security: [] parameters: - name: strong @@ -11077,24 +13939,36 @@ paths: type: boolean default: false required: false - - name: X-Plex-Client-Identifier - description: | - The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - in: query - schema: - type: string - example: gcgzw5rz2xovp84b4vha3a40 - required: true - name: X-Plex-Product + x-speakeasy-name-override: ClientName in: query required: false schema: type: string example: Plex Web + - name: X-Plex-Device + x-speakeasy-name-override: DeviceName + in: query + required: false + schema: + type: string + example: Linux + - name: X-Plex-Version + x-speakeasy-name-override: ClientVersion + in: query + required: false + schema: + type: string + example: 4.133.0 + - name: X-Plex-Platform + x-speakeasy-name-override: ClientPlatform + in: query + required: false + schema: + type: string + example: Chrome responses: - '200': + '201': description: Requests a new pin id used in the authentication flow content: application/json: @@ -11170,7 +14044,7 @@ paths: example: 7RQZ product: type: string - example: '0' + example: Tautulli trusted: type: boolean default: false @@ -11180,6 +14054,7 @@ paths: clientIdentifier: type: string description: The X-Client-Identifier used in the request + example: Tautulli location: title: GeoData type: object @@ -11235,9 +14110,9 @@ paths: description: The time zone of the country. example: America/St_Thomas postal_code: - type: integer + type: string description: The postal code of the location. - example: 802 + example: '802' in_privacy_restricted_country: type: boolean description: Indicates if the country has privacy restrictions. @@ -11270,7 +14145,10 @@ paths: format: date-time example: '2024-07-16T17:18:05Z' authToken: - type: 'null' + type: + - string + - 'null' + example: gcgzw5rz2xovp84b4vha3a40 newRegistration: type: 'null' '400': @@ -11288,6 +14166,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -11295,6 +14174,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 x-codeSamples: - lang: php @@ -11305,16 +14185,21 @@ paths: require 'vendor/autoload.php'; use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Operations; $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->build(); try { + $request = new Operations\GetPinRequest(); + $response = $sdk->plex->getPin($request); - $response = $sdk->plex->getPin('Postman', false, 'Postman'); - - if ($response->object !== null) { + if ($response->authPinContainer !== null) { // handle response } } catch (Throwable $e) { @@ -11322,7 +14207,7 @@ paths: } - lang: ruby label: getPin - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\n\n \nres = s.plex.get_pin(strong=false, x_plex_client_identifier=\"gcgzw5rz2xovp84b4vha3a40\", x_plex_product=\"Plex Web\")\n\nif ! res.auth_pin_container.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\n\n\nreq = ::PlexRubySDK::Operations::GetPinRequest.new()\n \nres = s.plex.get_pin(req)\n\nif ! res.auth_pin_container.nil?\n # handle response\nend" - lang: go label: getPin source: |- @@ -11331,16 +14216,21 @@ paths: import( "github.com/LukeHagar/plexgo" "context" + "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { s := plexgo.New( - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Plex.GetPin(ctx, nil, plexgo.String("gcgzw5rz2xovp84b4vha3a40"), plexgo.String("Plex Web")) + res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{}) if err != nil { log.Fatal(err) } @@ -11353,47 +14243,34 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetPinBadRequest; + import dev.plexapi.plexapi.models.operations.GetPinRequest; + import dev.plexapi.plexapi.models.operations.GetPinResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .xPlexClientIdentifier("Postman") + public static void main(String[] args) throws GetPinBadRequest, Exception { + + PlexAPI sdk = PlexAPI.builder() + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetPinRequest req = GetPinRequest.builder() .build(); - GetPinResponse res = sdk.plex().getPin() - .strong(false) - .xPlexClientIdentifier("Postman") - .xPlexProduct("Postman") + GetPinResponse res = sdk.plex().getPin() + .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetPinResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } - lang: typescript @@ -11410,16 +14287,6 @@ paths: description: Retrieve an Access Token from Plex.tv after the Pin has been authenticated operationId: getTokenByPinId parameters: - - name: X-Plex-Client-Identifier - description: | - The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - in: query - schema: - type: string - example: gcgzw5rz2xovp84b4vha3a40 - required: true - name: pinID description: The PinID to retrieve an access token for in: path @@ -11503,7 +14370,7 @@ paths: example: 7RQZ product: type: string - example: '0' + example: Tautulli trusted: type: boolean default: false @@ -11513,6 +14380,7 @@ paths: clientIdentifier: type: string description: The X-Client-Identifier used in the request + example: Tautulli location: title: GeoData type: object @@ -11568,9 +14436,9 @@ paths: description: The time zone of the country. example: America/St_Thomas postal_code: - type: integer + type: string description: The postal code of the location. - example: 802 + example: '802' in_privacy_restricted_country: type: boolean description: Indicates if the country has privacy restrictions. @@ -11603,7 +14471,10 @@ paths: format: date-time example: '2024-07-16T17:18:05Z' authToken: - type: 'null' + type: + - string + - 'null' + example: gcgzw5rz2xovp84b4vha3a40 newRegistration: type: 'null' '400': @@ -11621,6 +14492,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -11628,6 +14500,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '404': description: Not Found or Expired @@ -11653,7 +14526,7 @@ paths: message: Code not found or expired x-codeSamples: - lang: php - label: getToken + label: getTokenByPinId source: |- declare(strict_types=1); @@ -11662,14 +14535,18 @@ paths: use LukeHagar\Plex_API; $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->build(); try { - $response = $sdk->plex->getToken('', 'Postman'); + $response = $sdk->plex->getTokenByPinId(408895); - if ($response->object !== null) { + if ($response->authPinContainer !== null) { // handle response } } catch (Throwable $e) { @@ -11677,7 +14554,7 @@ paths: } - lang: ruby label: getTokenByPinId - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\n\n \nres = s.plex.get_token_by_pin_id(pin_id=408895, x_plex_client_identifier=\"gcgzw5rz2xovp84b4vha3a40\")\n\nif ! res.auth_pin_container.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\n\n \nres = s.plex.get_token_by_pin_id(pin_id=408895)\n\nif ! res.auth_pin_container.nil?\n # handle response\nend" - lang: go label: getTokenByPinId source: |- @@ -11691,11 +14568,15 @@ paths: func main() { s := plexgo.New( - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Plex.GetTokenByPinID(ctx, 408895, plexgo.String("gcgzw5rz2xovp84b4vha3a40")) + res, err := s.Plex.GetTokenByPinID(ctx, 408895) if err != nil { log.Fatal(err) } @@ -11704,50 +14585,35 @@ paths: } } - lang: java - label: getToken + label: getTokenByPinId source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTokenByPinIdBadRequest; + import dev.plexapi.plexapi.models.errors.GetTokenByPinIdResponseBody; + import dev.plexapi.plexapi.models.operations.GetTokenByPinIdResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetTokenByPinIdBadRequest, GetTokenByPinIdResponseBody, Exception { - GetTokenResponse res = sdk.plex().getToken() - .pinID("") - .xPlexClientIdentifier("Postman") + PlexAPI sdk = PlexAPI.builder() + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTokenByPinIdResponse res = sdk.plex().getTokenByPinId() + .pinID(408895L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetTokenResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.authPinContainer().isPresent()) { + // handle response } - } } - lang: typescript @@ -11890,6 +14756,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -11897,6 +14764,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -11913,6 +14781,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -11920,6 +14789,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -11933,20 +14803,24 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { $request = new Operations\CreatePlaylistRequest( title: '', - type: Operations\QueryParamType::Photo, + type: Operations\CreatePlaylistQueryParamType::Photo, smart: Operations\Smart::One, - uri: 'https://inborn-brochure.biz', - playQueueID: 3686.33, + uri: 'https://hoarse-testing.info/', ); $response = $sdk->playlists->createPlaylist($request); @@ -11958,7 +14832,7 @@ paths: } - lang: ruby label: createPlaylist - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::CreatePlaylistRequest.new(\n title: \"\",\n type: ::PlexRubySDK::Operations::CreatePlaylistQueryParamType::PHOTO,\n smart: ::PlexRubySDK::Operations::Smart::ONE,\n uri: \"https://inborn-brochure.biz\",\n)\n \nres = s.playlists.create_playlist(req)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::CreatePlaylistRequest.new(\n title: \"\",\n type: ::PlexRubySDK::Operations::CreatePlaylistQueryParamType::PHOTO,\n smart: ::PlexRubySDK::Operations::Smart::ONE,\n uri: \"https://hoarse-testing.info/\",\n)\n \nres = s.playlists.create_playlist(req)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: createPlaylist source: |- @@ -11974,7 +14848,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -11982,7 +14860,7 @@ paths: Title: "", Type: operations.CreatePlaylistQueryParamTypePhoto, Smart: operations.SmartOne, - URI: "https://inborn-brochure.biz", + URI: "https://hoarse-testing.info/", }) if err != nil { log.Fatal(err) @@ -11996,54 +14874,42 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.CreatePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.CreatePlaylistUnauthorized; + import dev.plexapi.plexapi.models.operations.CreatePlaylistQueryParamType; + import dev.plexapi.plexapi.models.operations.CreatePlaylistRequest; + import dev.plexapi.plexapi.models.operations.CreatePlaylistResponse; + import dev.plexapi.plexapi.models.operations.Smart; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() + public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); - CreatePlaylistRequest req = CreatePlaylistRequest.builder() + CreatePlaylistRequest req = CreatePlaylistRequest.builder() .title("") - .type(QueryParamType.PHOTO) + .type(CreatePlaylistQueryParamType.PHOTO) .smart(Smart.ONE) - .uri("") + .uri("https://hoarse-testing.info/") .build(); - CreatePlaylistResponse res = sdk.playlists().createPlaylist() + CreatePlaylistResponse res = sdk.playlists().createPlaylist() .request(req) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.CreatePlaylistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -12164,6 +15030,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -12171,6 +15038,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -12187,6 +15055,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -12194,6 +15063,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -12207,11 +15077,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -12226,7 +15101,7 @@ paths: } - lang: ruby label: getPlaylists - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlists(playlist_type=::PlexRubySDK::Operations::PlaylistType::AUDIO, smart=::PlexRubySDK::Operations::QueryParamSmart::ZERO)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlists(playlist_type=::PlexRubySDK::Operations::PlaylistType::AUDIO, smart=::PlexRubySDK::Operations::QueryParamSmart::ZERO)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getPlaylists source: |- @@ -12241,7 +15116,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -12258,48 +15137,35 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetPlaylistsBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetPlaylistsResponse; + import dev.plexapi.plexapi.models.operations.PlaylistType; + import dev.plexapi.plexapi.models.operations.QueryParamSmart; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception { - GetPlaylistsResponse res = sdk.playlists().getPlaylists() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetPlaylistsResponse res = sdk.playlists().getPlaylists() .playlistType(PlaylistType.AUDIO) .smart(QueryParamSmart.ZERO) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -12405,6 +15271,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -12412,6 +15279,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -12428,6 +15296,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -12435,6 +15304,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -12447,11 +15317,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -12466,7 +15341,7 @@ paths: } - lang: ruby label: getPlaylist - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlist(playlist_id=4109.48)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlist(playlist_id=4109.48)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getPlaylist source: |- @@ -12481,7 +15356,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -12498,47 +15377,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetPlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistUnauthorized; + import dev.plexapi.plexapi.models.operations.GetPlaylistResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception { - GetPlaylistResponse res = sdk.playlists().getPlaylist() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetPlaylistResponse res = sdk.playlists().getPlaylist() .playlistID(4109.48d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -12576,6 +15440,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -12583,6 +15448,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -12599,6 +15465,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -12606,6 +15473,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -12618,11 +15486,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -12637,7 +15510,7 @@ paths: } - lang: ruby label: deletePlaylist - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.delete_playlist(playlist_id=216.22)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.delete_playlist(playlist_id=216.22)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: deletePlaylist source: |- @@ -12652,7 +15525,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -12669,45 +15546,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.DeletePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.DeletePlaylistUnauthorized; + import dev.plexapi.plexapi.models.operations.DeletePlaylistResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception { - DeletePlaylistResponse res = sdk.playlists().deletePlaylist() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + DeletePlaylistResponse res = sdk.playlists().deletePlaylist() .playlistID(216.22d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.DeletePlaylistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -12757,6 +15619,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -12764,6 +15627,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -12780,6 +15644,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -12787,6 +15652,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -12799,16 +15665,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->playlists->updatePlaylist(3915, '', ''); + $response = $sdk->playlists->updatePlaylist(3915.00, '', ''); if ($response->statusCode === 200) { // handle response @@ -12818,7 +15689,7 @@ paths: } - lang: ruby label: updatePlaylist - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.update_playlist(playlist_id=3915, title=\"\", summary=\"\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.update_playlist(playlist_id=3915.00, title=\"\", summary=\"\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: updatePlaylist source: |- @@ -12833,11 +15704,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Playlists.UpdatePlaylist(ctx, 3915, nil, nil) + res, err := s.Playlists.UpdatePlaylist(ctx, 3915.00, nil, nil) if err != nil { log.Fatal(err) } @@ -12850,47 +15725,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.UpdatePlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.UpdatePlaylistUnauthorized; + import dev.plexapi.plexapi.models.operations.UpdatePlaylistResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception { - UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() - .playlistID(3915d) + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() + .playlistID(3915.00d) .title("") .summary("") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.UpdatePlaylistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -12927,6 +15787,11 @@ paths: - 3 - 4 example: 2 + x-speakeasy-enums: + - MOVIE + - TV_SHOW + - SEASON + - EPISODE required: true responses: '200': @@ -13208,6 +16073,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -13215,6 +16081,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -13231,6 +16098,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -13238,6 +16106,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -13249,17 +16118,23 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->playlists->getPlaylistContents(5004.46, 9403.59); + $response = $sdk->playlists->getPlaylistContents(5004.46, Operations\GetPlaylistContentsQueryParamType::TvShow); if ($response->object !== null) { // handle response @@ -13269,7 +16144,7 @@ paths: } - lang: ruby label: getPlaylistContents - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlist_contents(playlist_id=5004.46, type=::PlexRubySDK::Operations::GetPlaylistContentsQueryParamType::TWO)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.get_playlist_contents(playlist_id=5004.46, type=::PlexRubySDK::Operations::GetPlaylistContentsQueryParamType::TV_SHOW)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getPlaylistContents source: |- @@ -13285,11 +16160,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Playlists.GetPlaylistContents(ctx, 5004.46, operations.GetPlaylistContentsQueryParamTypeTwo) + res, err := s.Playlists.GetPlaylistContents(ctx, 5004.46, operations.GetPlaylistContentsQueryParamTypeTvShow) if err != nil { log.Fatal(err) } @@ -13302,48 +16181,34 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.GetPlaylistContentsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetPlaylistContentsQueryParamType; + import dev.plexapi.plexapi.models.operations.GetPlaylistContentsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception { - GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() .playlistID(5004.46d) - .type(9403.59d) + .type(GetPlaylistContentsQueryParamType.TvShow) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetPlaylistContentsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -13381,6 +16246,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -13388,6 +16254,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -13404,6 +16271,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -13411,6 +16279,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -13423,11 +16292,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -13442,7 +16316,7 @@ paths: } - lang: ruby label: clearPlaylistContents - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.clear_playlist_contents(playlist_id=1893.18)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.clear_playlist_contents(playlist_id=1893.18)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: clearPlaylistContents source: |- @@ -13457,7 +16331,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -13474,45 +16352,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.ClearPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.ClearPlaylistContentsUnauthorized; + import dev.plexapi.plexapi.models.operations.ClearPlaylistContentsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception { - ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() .playlistID(1893.18d) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.ClearPlaylistContentsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -13633,6 +16496,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -13640,6 +16504,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -13656,6 +16521,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -13663,6 +16529,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -13675,16 +16542,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->playlists->addPlaylistContents(8502.01, 'server://12345/com.plexapp.plugins.library/library/metadata/1', 123); + $response = $sdk->playlists->addPlaylistContents(8502.00, 'server://12345/com.plexapp.plugins.library/library/metadata/1', 123); if ($response->object !== null) { // handle response @@ -13694,7 +16566,7 @@ paths: } - lang: ruby label: addPlaylistContents - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.add_playlist_contents(playlist_id=8502.01, uri=\"server://12345/com.plexapp.plugins.library/library/metadata/1\", play_queue_id=123.0)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.add_playlist_contents(playlist_id=8502.00, uri=\"server://12345/com.plexapp.plugins.library/library/metadata/1\", play_queue_id=123.0)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: addPlaylistContents source: |- @@ -13709,11 +16581,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Playlists.AddPlaylistContents(ctx, 8502.01, "server://12345/com.plexapp.plugins.library/library/metadata/1", plexgo.Float64(123)) + res, err := s.Playlists.AddPlaylistContents(ctx, 8502.00, "server://12345/com.plexapp.plugins.library/library/metadata/1", plexgo.Float64(123)) if err != nil { log.Fatal(err) } @@ -13726,49 +16602,34 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.AddPlaylistContentsBadRequest; + import dev.plexapi.plexapi.models.errors.AddPlaylistContentsUnauthorized; + import dev.plexapi.plexapi.models.operations.AddPlaylistContentsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception { - AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() - .playlistID(8502.01d) + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() + .playlistID(8502.00d) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") .playQueueID(123d) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.AddPlaylistContentsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -13799,6 +16660,14 @@ paths: - 0 - 1 required: true + - name: sectionID + description: 'Possibly the section ID to upload the playlist to, we are not certain.' + in: query + schema: + type: integer + example: 1 + default: 1 + required: true responses: '200': description: The playlist is uploaded @@ -13817,6 +16686,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -13824,6 +16694,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -13840,6 +16711,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -13847,6 +16719,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -13860,16 +16733,21 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->playlists->uploadPlaylist('/home/barkley/playlist.m3u', Operations\Force::Zero); + $response = $sdk->playlists->uploadPlaylist('/home/barkley/playlist.m3u', Operations\QueryParamForce::Zero, 1); if ($response->statusCode === 200) { // handle response @@ -13879,7 +16757,7 @@ paths: } - lang: ruby label: uploadPlaylist - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.upload_playlist(path=\"/home/barkley/playlist.m3u\", force=::PlexRubySDK::Operations::QueryParamForce::ZERO)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.playlists.upload_playlist(path=\"/home/barkley/playlist.m3u\", force=::PlexRubySDK::Operations::QueryParamForce::ZERO, section_id=1)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: uploadPlaylist source: |- @@ -13895,11 +16773,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Playlists.UploadPlaylist(ctx, "/home/barkley/playlist.m3u", operations.QueryParamForceZero) + res, err := s.Playlists.UploadPlaylist(ctx, "/home/barkley/playlist.m3u", operations.QueryParamForceZero, 1) if err != nil { log.Fatal(err) } @@ -13912,46 +16794,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.UploadPlaylistBadRequest; + import dev.plexapi.plexapi.models.errors.UploadPlaylistUnauthorized; + import dev.plexapi.plexapi.models.operations.QueryParamForce; + import dev.plexapi.plexapi.models.operations.UploadPlaylistResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception { - UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() .path("/home/barkley/playlist.m3u") - .force(Force.ZERO) + .force(QueryParamForce.ZERO) + .sectionID(1L) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.UploadPlaylistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -14095,11 +16964,22 @@ paths: type: array items: type: object + required: + - type properties: key: type: string type: type: string + flavor: + type: string + example: global + scrobbleKey: + type: string + example: '/:/scrobble/new' + unscrobbleKey: + type: string + example: '/:/unscrobble/new' Directory: type: array items: @@ -14148,6 +17028,20 @@ paths: type: string symbol: type: string + Action: + type: array + items: + type: object + required: + - id + - key + properties: + id: + type: string + example: addToContinueWatching + key: + type: string + example: /actions/addToContinueWatching '400': description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' content: @@ -14163,6 +17057,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -14170,6 +17065,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -14186,6 +17082,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -14193,11 +17090,44 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: providers + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + + $response = $sdk->server->getMediaProviders('CV5xoxjTpFKUzBTShsaf'); + + if ($response->object !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: providers - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_media_providers(x_plex_token=\"CV5xoxjTpFKUzBTShsaf\")\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_media_providers(x_plex_token=\"CV5xoxjTpFKUzBTShsaf\")\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: providers source: |- @@ -14212,7 +17142,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -14224,6 +17158,39 @@ paths: // handle response } } + - lang: java + label: providers + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetMediaProvidersBadRequest; + import dev.plexapi.plexapi.models.errors.GetMediaProvidersUnauthorized; + import dev.plexapi.plexapi.models.operations.GetMediaProvidersResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetMediaProvidersResponse res = sdk.server().getMediaProviders() + .xPlexToken("CV5xoxjTpFKUzBTShsaf") + .call(); + + if (res.object().isPresent()) { + // handle response + } + } + } - lang: typescript label: providers source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getMediaProviders(\"CV5xoxjTpFKUzBTShsaf\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -14498,6 +17465,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -14505,6 +17473,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -14521,6 +17490,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -14528,6 +17498,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -14540,11 +17511,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -14559,7 +17535,7 @@ paths: } - lang: ruby label: getSearchResults - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.get_search_results(query=\"110\")\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.search.get_search_results(query=\"110\")\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getSearchResults source: |- @@ -14574,7 +17550,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -14591,47 +17571,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSearchResultsBadRequest; + import dev.plexapi.plexapi.models.errors.GetSearchResultsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSearchResultsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception { - GetSearchResultsResponse res = sdk.search().getSearchResults() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetSearchResultsResponse res = sdk.search().getSearchResults() .query("110") .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetSearchResultsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -14680,6 +17645,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -14687,6 +17653,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -14703,6 +17670,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -14710,6 +17678,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -14723,11 +17692,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -14742,7 +17716,7 @@ paths: } - lang: ruby label: getTransientToken - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_transient_token(type=::PlexRubySDK::Operations::GetTransientTokenQueryParamType::DELEGATION, scope=::PlexRubySDK::Operations::Scope::ALL)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_transient_token(type=::PlexRubySDK::Operations::GetTransientTokenQueryParamType::DELEGATION, scope=::PlexRubySDK::Operations::Scope::ALL)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: getTransientToken source: |- @@ -14758,7 +17732,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -14775,46 +17753,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTransientTokenBadRequest; + import dev.plexapi.plexapi.models.errors.GetTransientTokenUnauthorized; + import dev.plexapi.plexapi.models.operations.GetTransientTokenQueryParamType; + import dev.plexapi.plexapi.models.operations.GetTransientTokenResponse; + import dev.plexapi.plexapi.models.operations.Scope; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception { - GetTransientTokenResponse res = sdk.authentication().getTransientToken() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTransientTokenResponse res = sdk.authentication().getTransientToken() .type(GetTransientTokenQueryParamType.DELEGATION) .scope(Scope.ALL) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.GetTransientTokenResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -14857,6 +17822,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -14864,6 +17830,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -14880,6 +17847,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -14887,6 +17855,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -14899,16 +17868,21 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->authentication->getSourceConnectionInformation('server://client-identifier'); + $response = $sdk->authentication->getSourceConnectionInformation('provider://provider-identifier'); if ($response->statusCode === 200) { // handle response @@ -14918,7 +17892,7 @@ paths: } - lang: ruby label: getSourceConnectionInformation - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_source_connection_information(source=\"server://client-identifier\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_source_connection_information(source=\"provider://provider-identifier\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: getSourceConnectionInformation source: |- @@ -14933,11 +17907,15 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Authentication.GetSourceConnectionInformation(ctx, "server://client-identifier") + res, err := s.Authentication.GetSourceConnectionInformation(ctx, "provider://provider-identifier") if err != nil { log.Fatal(err) } @@ -14950,45 +17928,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationBadRequest; + import dev.plexapi.plexapi.models.errors.GetSourceConnectionInformationUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSourceConnectionInformationResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception { - GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() - .source("server://client-identifier") + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() + .source("provider://provider-identifier") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.GetSourceConnectionInformationResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -15053,6 +18016,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -15060,6 +18024,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -15076,6 +18041,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -15083,6 +18049,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -15095,11 +18062,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -15113,7 +18085,7 @@ paths: } - lang: ruby label: getServerList - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_list()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.server.get_server_list()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getServerList source: |- @@ -15128,7 +18100,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -15145,46 +18121,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetServerListBadRequest; + import dev.plexapi.plexapi.models.errors.GetServerListUnauthorized; + import dev.plexapi.plexapi.models.operations.GetServerListResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception { - GetServerListResponse res = sdk.server().getServerList() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetServerListResponse res = sdk.server().getServerList() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetServerListResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -15323,6 +18284,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -15330,6 +18292,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -15346,6 +18309,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -15353,6 +18317,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -15365,11 +18330,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -15384,7 +18354,7 @@ paths: } - lang: ruby label: getStatistics - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getStatistics source: |- @@ -15399,7 +18369,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -15416,47 +18390,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetStatisticsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetStatisticsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception { - GetStatisticsResponse res = sdk.statistics().getStatistics() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetStatisticsResponse res = sdk.statistics().getStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetStatisticsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -15536,6 +18495,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -15543,6 +18503,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -15559,6 +18520,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -15566,6 +18528,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -15578,11 +18541,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -15597,7 +18565,7 @@ paths: } - lang: ruby label: getResourcesStatistics - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_resources_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_resources_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getResourcesStatistics source: |- @@ -15612,7 +18580,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -15629,47 +18601,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetResourcesStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetResourcesStatisticsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetResourcesStatisticsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception { - GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetResourcesStatisticsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -15801,6 +18758,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -15808,6 +18766,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -15824,6 +18783,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -15831,6 +18791,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -15843,11 +18804,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -15862,7 +18828,7 @@ paths: } - lang: ruby label: getBandwidthStatistics - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_bandwidth_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.statistics.get_bandwidth_statistics(timespan=4)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getBandwidthStatistics source: |- @@ -15877,7 +18843,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -15894,47 +18864,32 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsBadRequest; + import dev.plexapi.plexapi.models.errors.GetBandwidthStatisticsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetBandwidthStatisticsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception { - GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() .timespan(4L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetBandwidthStatisticsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -16297,6 +19252,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -16304,6 +19260,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -16320,6 +19277,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -16327,6 +19285,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -16339,11 +19298,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -16357,7 +19321,7 @@ paths: } - lang: ruby label: getSessions - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_sessions()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_sessions()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getSessions source: |- @@ -16372,7 +19336,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -16389,46 +19357,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSessionsBadRequest; + import dev.plexapi.plexapi.models.errors.GetSessionsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSessionsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception { - GetSessionsResponse res = sdk.sessions().getSessions() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetSessionsResponse res = sdk.sessions().getSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetSessionsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -16591,6 +19544,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -16598,6 +19552,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -16614,6 +19569,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -16621,6 +19577,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -16634,17 +19591,20 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $filter = new Operations\Filter( - - ); + $filter = new Operations\QueryParamFilter(); $response = $sdk->sessions->getSessionHistory('', 1, $filter, 12); if ($response->object !== null) { @@ -16655,7 +19615,7 @@ paths: } - lang: ruby label: getSessionHistory - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_session_history(sort=\"\", account_id=1, filter=::PlexRubySDK::Operations::QueryParamFilter.new(), library_section_id=12)\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_session_history(sort=\"\", account_id=1, filter=::PlexRubySDK::Operations::QueryParamFilter.new(), library_section_id=12)\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getSessionHistory source: |- @@ -16671,7 +19631,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -16688,51 +19652,37 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetSessionHistoryBadRequest; + import dev.plexapi.plexapi.models.errors.GetSessionHistoryUnauthorized; + import dev.plexapi.plexapi.models.operations.GetSessionHistoryResponse; + import dev.plexapi.plexapi.models.operations.QueryParamFilter; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception { - GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() .sort("") .accountId(1L) - .filter(Filter.builder() + .filter(QueryParamFilter.builder() .build()) .librarySectionID(12L) .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetSessionHistoryResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -16881,6 +19831,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -16888,6 +19839,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -16904,6 +19856,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -16911,6 +19864,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -16923,11 +19877,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -16941,7 +19900,7 @@ paths: } - lang: ruby label: getTranscodeSessions - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_transcode_sessions()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.get_transcode_sessions()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getTranscodeSessions source: |- @@ -16956,7 +19915,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -16973,46 +19936,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTranscodeSessionsBadRequest; + import dev.plexapi.plexapi.models.errors.GetTranscodeSessionsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetTranscodeSessionsResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception { - GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetTranscodeSessionsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -17051,6 +19999,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -17058,6 +20007,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -17074,6 +20024,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -17081,6 +20032,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -17093,11 +20045,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -17112,7 +20069,7 @@ paths: } - lang: ruby label: stopTranscodeSession - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.stop_transcode_session(session_key=\"zz7llzqlx8w9vnrsbnwhbmep\")\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.sessions.stop_transcode_session(session_key=\"zz7llzqlx8w9vnrsbnwhbmep\")\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: stopTranscodeSession source: |- @@ -17127,7 +20084,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -17144,45 +20105,30 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StopTranscodeSessionBadRequest; + import dev.plexapi.plexapi.models.errors.StopTranscodeSessionUnauthorized; + import dev.plexapi.plexapi.models.operations.StopTranscodeSessionResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception { - StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() .sessionKey("zz7llzqlx8w9vnrsbnwhbmep") .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StopTranscodeSessionResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -17303,6 +20249,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -17310,6 +20257,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -17326,6 +20274,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -17333,6 +20282,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -17345,11 +20295,16 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -17363,7 +20318,7 @@ paths: } - lang: ruby label: getUpdateStatus - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.get_update_status()\n\nif ! res.object.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.get_update_status()\n\nif ! res.object.nil?\n # handle response\nend" - lang: go label: getUpdateStatus source: |- @@ -17378,7 +20333,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -17395,46 +20354,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetUpdateStatusBadRequest; + import dev.plexapi.plexapi.models.errors.GetUpdateStatusUnauthorized; + import dev.plexapi.plexapi.models.operations.GetUpdateStatusResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception { - GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() .call(); - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetUpdateStatusResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; + if (res.object().isPresent()) { + // handle response } - } } - lang: typescript @@ -17476,6 +20420,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -17483,6 +20428,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -17499,6 +20445,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -17506,6 +20453,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -17519,11 +20467,16 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { @@ -17538,7 +20491,7 @@ paths: } - lang: ruby label: checkForUpdates - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.check_for_updates(download=::PlexRubySDK::Operations::Download::ONE)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.check_for_updates(download=::PlexRubySDK::Operations::Download::ONE)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: checkForUpdates source: |- @@ -17554,7 +20507,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -17571,45 +20528,31 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.CheckForUpdatesBadRequest; + import dev.plexapi.plexapi.models.errors.CheckForUpdatesUnauthorized; + import dev.plexapi.plexapi.models.operations.CheckForUpdatesResponse; + import dev.plexapi.plexapi.models.operations.Download; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception { - CheckForUpdatesResponse res = sdk.updater().checkForUpdates() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + CheckForUpdatesResponse res = sdk.updater().checkForUpdates() .download(Download.ONE) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.CheckForUpdatesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -17662,6 +20605,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -17669,6 +20613,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -17685,6 +20630,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -17692,6 +20638,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 '500': description: If the update process failed to start @@ -17707,16 +20654,21 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { - $response = $sdk->updater->applyUpdates(Operations\Tonight::One, Operations\Skip::Zero); + $response = $sdk->updater->applyUpdates(Operations\Tonight::One, Operations\Skip::One); if ($response->statusCode === 200) { // handle response @@ -17726,7 +20678,7 @@ paths: } - lang: ruby label: applyUpdates - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.apply_updates(tonight=::PlexRubySDK::Operations::Tonight::ONE, skip=::PlexRubySDK::Operations::Skip::ONE)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.updater.apply_updates(tonight=::PlexRubySDK::Operations::Tonight::ONE, skip=::PlexRubySDK::Operations::Skip::ONE)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: applyUpdates source: |- @@ -17742,7 +20694,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -17759,46 +20715,33 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.ApplyUpdatesBadRequest; + import dev.plexapi.plexapi.models.errors.ApplyUpdatesUnauthorized; + import dev.plexapi.plexapi.models.operations.ApplyUpdatesResponse; + import dev.plexapi.plexapi.models.operations.Skip; + import dev.plexapi.plexapi.models.operations.Tonight; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception { - ApplyUpdatesResponse res = sdk.updater().applyUpdates() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + ApplyUpdatesResponse res = sdk.updater().applyUpdates() .tonight(Tonight.ONE) .skip(Skip.ONE) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.ApplyUpdatesResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -17942,6 +20885,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -17949,6 +20893,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -17965,6 +20910,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -17972,6 +20918,7 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: - lang: php @@ -17985,24 +20932,36 @@ paths: use LukeHagar\Plex_API\Models\Components; use LukeHagar\Plex_API\Models\Operations; - $security = new Components\Security(); - $security->accessToken = ''; + $security = new Components\Security( + accessToken: "", + ); $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') ->setSecurity($security)->build(); try { $request = new Operations\StartUniversalTranscodeRequest( 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, ); $response = $sdk->video->startUniversalTranscode($request); @@ -18014,7 +20973,7 @@ paths: } - lang: ruby label: startUniversalTranscode - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::StartUniversalTranscodeRequest.new(\n has_mde: 1.0,\n path: \"/library/metadata/23409\",\n media_index: 0.0,\n part_index: 0.0,\n protocol: \"hls\",\n fast_seek: 0.0,\n direct_play: 0.0,\n direct_stream: 0.0,\n subtitle_size: 100.0,\n subtites: \"burn\",\n audio_boost: 100.0,\n location: \"lan\",\n media_buffer_size: 102400.0,\n session: \"zvcage8b7rkioqcm8f4uns4c\",\n add_debug_overlay: 0.0,\n auto_adjust_quality: 0.0,\n)\n \nres = s.video.start_universal_transcode(req)\n\nif res.status_code == 200\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::PlexRubySDK::Operations::StartUniversalTranscodeRequest.new(\n has_mde: 1.0,\n path: \"/library/metadata/23409\",\n media_index: 0.0,\n part_index: 0.0,\n protocol: \"hls\",\n fast_seek: 0.0,\n direct_play: 0.0,\n direct_stream: 0.0,\n subtitle_size: 100.0,\n subtites: \"burn\",\n audio_boost: 100.0,\n location: \"lan\",\n media_buffer_size: 102400.0,\n session: \"zvcage8b7rkioqcm8f4uns4c\",\n add_debug_overlay: 0.0,\n auto_adjust_quality: 0.0,\n)\n \nres = s.video.start_universal_transcode(req)\n\nif res.status_code == 200\n # handle response\nend" - lang: go label: startUniversalTranscode source: |- @@ -18030,7 +20989,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -18064,30 +21027,27 @@ paths: source: |- package hello.world; - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.StartUniversalTranscodeBadRequest; + import dev.plexapi.plexapi.models.errors.StartUniversalTranscodeUnauthorized; + import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeRequest; + import dev.plexapi.plexapi.models.operations.StartUniversalTranscodeResponse; + import java.lang.Exception; public class Application { - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); + public static void main(String[] args) throws StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception { - StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() .hasMDE(1d) .path("/library/metadata/23409") .mediaIndex(0d) @@ -18106,22 +21066,11 @@ paths: .autoAdjustQuality(0d) .build(); - StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() + StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() .request(req) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.StartUniversalTranscodeResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - + // handle response } } - lang: typescript @@ -18272,6 +21221,7 @@ paths: - twoFactorEnabled - username - uuid + - attributionPartner properties: adsConsent: type: @@ -18367,7 +21317,7 @@ paths: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 locale: type: @@ -18396,55 +21346,97 @@ paths: title: UserProfile type: object required: + - autoSelectAudio - defaultAudioLanguage - defaultSubtitleLanguage + - autoSelectSubtitle + - defaultSubtitleAccessibility + - defaultSubtitleForced + - watchedIndicator + - mediaReviewsVisibility properties: autoSelectAudio: + description: If the account has automatically select audio and subtitle tracks enabled type: boolean example: true default: true - description: If the account has automatically select audio and subtitle tracks enabled defaultAudioLanguage: + description: The preferred audio language for the account type: - string - 'null' example: ja - description: The preferred audio language for the account defaultSubtitleLanguage: + description: The preferred subtitle language for the account type: - string - 'null' example: en - description: The preferred subtitle language for the account autoSelectSubtitle: - example: 1 - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' - enum: - - 0 - - 1 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' defaultSubtitleAccessibility: - enum: - - 0 - - 1 - example: 1 - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)' defaultSubtitleForced: - enum: - - 0 - - 1 - example: 0 - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' watchedIndicator: - enum: - - 0 - - 1 - example: 1 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: Whether or not media watched indicators are enabled (little orange dot on media) mediaReviewsVisibility: - enum: - - 0 - - 1 - type: integer - example: 0 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: Whether or not the account has media reviews visibility enabled protected: type: boolean description: If the account has a Plex Home PIN enabled @@ -18453,7 +21445,7 @@ paths: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 restricted: type: boolean @@ -18716,6 +21708,11 @@ paths: type: string description: The account UUID example: dae343c1f45beb4f + attributionPartner: + type: + - string + - 'null' + example: null '400': description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' content: @@ -18731,6 +21728,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -18738,6 +21736,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -18754,6 +21753,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -18761,11 +21761,43 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: getTokenDetails + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Components; + + $security = new Components\Security( + accessToken: "", + ); + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->setSecurity($security)->build(); + + try { + $response = $sdk->authentication->getTokenDetails(); + + if ($response->userPlexAccount !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: getTokenDetails - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_token_details()\n\nif ! res.user_plex_account.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\ns.config_security(\n ::PlexRubySDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.authentication.get_token_details()\n\nif ! res.user_plex_account.nil?\n # handle response\nend" - lang: go label: getTokenDetails source: |- @@ -18780,7 +21812,11 @@ paths: func main() { s := plexgo.New( plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() @@ -18792,6 +21828,38 @@ paths: // handle response } } + - lang: java + label: getTokenDetails + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.GetTokenDetailsBadRequest; + import dev.plexapi.plexapi.models.errors.GetTokenDetailsUnauthorized; + import dev.plexapi.plexapi.models.operations.GetTokenDetailsResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .accessToken("") + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() + .call(); + + if (res.userPlexAccount().isPresent()) { + // handle response + } + } + } - lang: typescript label: getTokenDetails source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getTokenDetails();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" @@ -18805,17 +21873,6 @@ paths: summary: Get User Sign In Data description: Sign in user with username and password and return user data with Plex authentication token operationId: post-users-sign-in-data - parameters: - - name: X-Plex-Client-Identifier - description: | - The unique identifier for the client application - This is used to track the client application and its usage - (UUID, serial number, or other number unique per device) - in: query - schema: - type: string - example: gcgzw5rz2xovp84b4vha3a40 - required: true requestBody: content: application/x-www-form-urlencoded: @@ -18977,6 +22034,7 @@ paths: - twoFactorEnabled - username - uuid + - attributionPartner properties: adsConsent: type: @@ -19072,7 +22130,7 @@ paths: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 locale: type: @@ -19101,55 +22159,97 @@ paths: title: UserProfile type: object required: + - autoSelectAudio - defaultAudioLanguage - defaultSubtitleLanguage + - autoSelectSubtitle + - defaultSubtitleAccessibility + - defaultSubtitleForced + - watchedIndicator + - mediaReviewsVisibility properties: autoSelectAudio: + description: If the account has automatically select audio and subtitle tracks enabled type: boolean example: true default: true - description: If the account has automatically select audio and subtitle tracks enabled defaultAudioLanguage: + description: The preferred audio language for the account type: - string - 'null' example: ja - description: The preferred audio language for the account defaultSubtitleLanguage: + description: The preferred subtitle language for the account type: - string - 'null' example: en - description: The preferred subtitle language for the account autoSelectSubtitle: - example: 1 - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' - enum: - - 0 - - 1 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' defaultSubtitleAccessibility: - enum: - - 0 - - 1 - example: 1 - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)' defaultSubtitleForced: - enum: - - 0 - - 1 - example: 0 - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' watchedIndicator: - enum: - - 0 - - 1 - example: 1 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: Whether or not media watched indicators are enabled (little orange dot on media) mediaReviewsVisibility: - enum: - - 0 - - 1 - type: integer - example: 0 + allOf: + - type: integer + format: int32 + enum: + - 0 + - 1 + example: 1 + default: 0 + x-speakeasy-enums: + - DISABLE + - ENABLE + - description: Whether or not the account has media reviews visibility enabled protected: type: boolean description: If the account has a Plex Home PIN enabled @@ -19158,7 +22258,7 @@ paths: type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 restricted: type: boolean @@ -19421,6 +22521,11 @@ paths: type: string description: The account UUID example: dae343c1f45beb4f + attributionPartner: + type: + - string + - 'null' + example: null - type: object required: - pastSubscriptions @@ -19461,7 +22566,7 @@ paths: - type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 - type: 'null' endsAt: @@ -19469,7 +22574,7 @@ paths: - type: - integer example: 1556281940 - description: Unix epoch datetime + description: Unix epoch datetime in seconds format: int64 - type: 'null' canceled: @@ -19542,6 +22647,7 @@ paths: properties: code: type: integer + format: int32 example: 1000 message: type: string @@ -19549,6 +22655,7 @@ paths: example: X-Plex-Client-Identifier is missing status: type: integer + format: int32 example: 400 '401': description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. @@ -19565,6 +22672,7 @@ paths: properties: code: type: integer + format: int32 example: 1001 message: type: string @@ -19572,11 +22680,44 @@ paths: example: User could not be authenticated status: type: integer + format: int32 example: 401 x-codeSamples: + - lang: php + label: data + source: |- + declare(strict_types=1); + + require 'vendor/autoload.php'; + + use LukeHagar\Plex_API; + use LukeHagar\Plex_API\Models\Operations; + + $sdk = Plex_API\PlexAPI::builder() + ->setClientID('gcgzw5rz2xovp84b4vha3a40') + ->setClientName('Plex Web') + ->setClientVersion('4.133.0') + ->setClientPlatform('Chrome') + ->setDeviceName('Linux') + ->build(); + + try { + $request = new Operations\PostUsersSignInDataRequestBody( + login: 'username@email.com', + password: 'password123', + verificationCode: '123456', + ); + $response = $sdk->authentication->postUsersSignInData($request); + + if ($response->userPlexAccount !== null) { + // handle response + } + } catch (Throwable $e) { + // handle exception + } - lang: ruby label: data - source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n x_plex_client_identifier: \"gcgzw5rz2xovp84b4vha3a40\",\n )\n\n \nres = s.authentication.post_users_sign_in_data(x_plex_client_identifier=\"gcgzw5rz2xovp84b4vha3a40\", request_body=::PlexRubySDK::Operations::PostUsersSignInDataRequestBody.new(\n login: \"username@email.com\",\n password: \"password123\",\n verification_code: \"123456\",\n))\n\nif ! res.user_plex_account.nil?\n # handle response\nend" + source: "require 'plex_ruby_sdk'\n\n\ns = ::PlexRubySDK::PlexAPI.new(\n client_id: \"gcgzw5rz2xovp84b4vha3a40\",\n client_name: \"Plex Web\",\n client_version: \"4.133.0\",\n client_platform: \"Chrome\",\n device_name: \"Linux\",\n )\n\n\nreq = ::PlexRubySDK::Operations::PostUsersSignInDataRequestBody.new(\n login: \"username@email.com\",\n password: \"password123\",\n verification_code: \"123456\",\n)\n \nres = s.authentication.post_users_sign_in_data(req)\n\nif ! res.user_plex_account.nil?\n # handle response\nend" - lang: go label: data source: |- @@ -19591,11 +22732,15 @@ paths: func main() { s := plexgo.New( - plexgo.WithXPlexClientIdentifier("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"), + plexgo.WithClientName("Plex Web"), + plexgo.WithClientVersion("4.133.0"), + plexgo.WithClientPlatform("Chrome"), + plexgo.WithDeviceName("Linux"), ) ctx := context.Background() - res, err := s.Authentication.PostUsersSignInData(ctx, plexgo.String("gcgzw5rz2xovp84b4vha3a40"), &operations.PostUsersSignInDataRequestBody{ + res, err := s.Authentication.PostUsersSignInData(ctx, &operations.PostUsersSignInDataRequestBody{ Login: "username@email.com", Password: "password123", VerificationCode: plexgo.String("123456"), @@ -19607,6 +22752,45 @@ paths: // handle response } } + - lang: java + label: data + source: |- + package hello.world; + + import dev.plexapi.plexapi.PlexAPI; + import dev.plexapi.plexapi.models.errors.PostUsersSignInDataBadRequest; + import dev.plexapi.plexapi.models.errors.PostUsersSignInDataUnauthorized; + import dev.plexapi.plexapi.models.operations.PostUsersSignInDataRequestBody; + import dev.plexapi.plexapi.models.operations.PostUsersSignInDataResponse; + import java.lang.Exception; + + public class Application { + + public static void main(String[] args) throws PostUsersSignInDataBadRequest, PostUsersSignInDataUnauthorized, Exception { + + PlexAPI sdk = PlexAPI.builder() + .clientID("gcgzw5rz2xovp84b4vha3a40") + .clientName("Plex Web") + .clientVersion("4.133.0") + .clientPlatform("Chrome") + .deviceName("Linux") + .build(); + + PostUsersSignInDataRequestBody req = PostUsersSignInDataRequestBody.builder() + .login("username@email.com") + .password("password123") + .verificationCode("123456") + .build(); + + PostUsersSignInDataResponse res = sdk.authentication().postUsersSignInData() + .request(req) + .call(); + + if (res.userPlexAccount().isPresent()) { + // handle response + } + } + } - lang: typescript label: data source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.postUsersSignInData(\"gcgzw5rz2xovp84b4vha3a40\", {\n login: \"username@email.com\",\n password: \"password123\",\n verificationCode: \"123456\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();"