mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 12:47:44 +00:00
262 lines
8.4 KiB
Python
262 lines
8.4 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from plex_api_client import PlexAPI
|
|
from plex_api_client.models import operations
|
|
|
|
|
|
def test_server_get_server_capabilities():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_server_capabilities()
|
|
assert res.status_code == 200
|
|
|
|
|
|
def test_server_get_server_preferences():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_server_preferences()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetServerPreferencesResponseBody(
|
|
media_container=operations.GetServerPreferencesMediaContainer(
|
|
size=161,
|
|
setting=[
|
|
operations.Setting(
|
|
id="EnableDatabaseTrace",
|
|
label="",
|
|
summary="",
|
|
type="bool",
|
|
default=False,
|
|
value=False,
|
|
hidden=True,
|
|
advanced=False,
|
|
group="",
|
|
enum_values="1:admin only|2:everyone",
|
|
),
|
|
],
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_available_clients():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_available_clients()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetAvailableClientsResponseBody(
|
|
media_container=operations.GetAvailableClientsMediaContainer(
|
|
size=1,
|
|
server=[
|
|
operations.Server(
|
|
name="iPad",
|
|
host="10.10.10.102",
|
|
address="10.10.10.102",
|
|
port=32500,
|
|
machine_identifier="A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05",
|
|
version="8.17",
|
|
protocol="plex",
|
|
product="Plex for iOS",
|
|
device_class="tablet",
|
|
protocol_version=2,
|
|
protocol_capabilities="playback,playqueues,timeline,provider-playback",
|
|
),
|
|
],
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_devices():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_devices()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetDevicesResponseBody(
|
|
media_container=operations.GetDevicesMediaContainer(
|
|
size=151,
|
|
identifier="com.plexapp.system.devices",
|
|
device=[
|
|
operations.Device(
|
|
id=1,
|
|
name="iPhone",
|
|
platform="iOS",
|
|
created_at=1654131230,
|
|
),
|
|
],
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_server_identity():
|
|
s = PlexAPI()
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_server_identity()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetServerIdentityResponseBody(
|
|
media_container=operations.GetServerIdentityMediaContainer(
|
|
size=0,
|
|
machine_identifier="96f2fe7a78c9dc1f16a16bedbe90f98149be16b4",
|
|
version="1.31.3.6868-28fc46b27",
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_my_plex_account():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_my_plex_account()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetMyPlexAccountResponseBody(
|
|
my_plex=operations.MyPlex(
|
|
auth_token="Z5v-PrNASDFpsaCi3CPK7",
|
|
username="example.email@mail.com",
|
|
mapping_state="mapped",
|
|
sign_in_state="ok",
|
|
public_address="140.20.68.140",
|
|
public_port=32400,
|
|
private_address="10.10.10.47",
|
|
private_port=32400,
|
|
subscription_features="federated-auth,hardware_transcoding,home,hwtranscode,item_clusters,kevin-bacon,livetv,loudness,lyrics,music-analysis,music_videos,pass,photo_autotags,photos-v5,photosV6-edit,photosV6-tv-albums,premium_music_metadata,radio,server-manager,session_bandwidth_restrictions,session_kick,shared-radio,sync,trailers,tuner-sharing,type-first,unsupportedtuners,webhooks",
|
|
subscription_state="Active",
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_resized_photo():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_resized_photo(
|
|
request={
|
|
"width": 110,
|
|
"height": 165,
|
|
"opacity": 100,
|
|
"blur": 0,
|
|
"min_size": operations.MinSize.ONE,
|
|
"upscale": operations.Upscale.ONE,
|
|
"url": "/library/metadata/49564/thumb/1654258204",
|
|
}
|
|
)
|
|
assert res.status_code == 200
|
|
|
|
|
|
def test_server_get_media_providers():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_media_providers(x_plex_token="CV5xoxjTpFKUzBTShsaf")
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetMediaProvidersResponseBody(
|
|
media_container=operations.GetMediaProvidersMediaContainer(
|
|
media_provider=[
|
|
operations.MediaProvider(
|
|
feature=[
|
|
operations.Feature(
|
|
type="<value>",
|
|
flavor="global",
|
|
scrobble_key="/:/scrobble/new",
|
|
unscrobble_key="/:/unscrobble/new",
|
|
action=[
|
|
operations.Action(
|
|
id="addToContinueWatching",
|
|
key="/actions/addToContinueWatching",
|
|
),
|
|
],
|
|
),
|
|
operations.Feature(
|
|
type="<value>",
|
|
flavor="global",
|
|
scrobble_key="/:/scrobble/new",
|
|
unscrobble_key="/:/unscrobble/new",
|
|
action=[
|
|
operations.Action(
|
|
id="addToContinueWatching",
|
|
key="/actions/addToContinueWatching",
|
|
),
|
|
operations.Action(
|
|
id="addToContinueWatching",
|
|
key="/actions/addToContinueWatching",
|
|
),
|
|
],
|
|
),
|
|
operations.Feature(
|
|
type="<value>",
|
|
flavor="global",
|
|
scrobble_key="/:/scrobble/new",
|
|
unscrobble_key="/:/unscrobble/new",
|
|
action=[
|
|
operations.Action(
|
|
id="addToContinueWatching",
|
|
key="/actions/addToContinueWatching",
|
|
),
|
|
operations.Action(
|
|
id="addToContinueWatching",
|
|
key="/actions/addToContinueWatching",
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
)
|
|
|
|
|
|
def test_server_get_server_list():
|
|
s = PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
assert s is not None
|
|
|
|
res = s.server.get_server_list()
|
|
assert res.status_code == 200
|
|
assert res.object is not None
|
|
assert res.object == operations.GetServerListResponseBody(
|
|
media_container=operations.GetServerListMediaContainer(
|
|
size=1,
|
|
server=[
|
|
operations.GetServerListServer(
|
|
name="Hera",
|
|
host="10.10.10.47",
|
|
address="10.10.10.47",
|
|
port=32400,
|
|
machine_identifier="96f2fe7a78c9dc1f16a16bedbe90f98149be16b4",
|
|
version="1.31.3.6868-28fc46b27",
|
|
),
|
|
],
|
|
),
|
|
)
|