mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 20:47:45 +00:00
145 lines
4.4 KiB
Java
145 lines
4.4 KiB
Java
/*
|
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
*/
|
|
|
|
package dev.plexapi.sdk;
|
|
|
|
import dev.plexapi.sdk.models.operations.GetBannerImageRequest;
|
|
import dev.plexapi.sdk.models.operations.GetBannerImageResponse;
|
|
import dev.plexapi.sdk.models.operations.GetThumbImageRequest;
|
|
import dev.plexapi.sdk.models.operations.GetThumbImageResponse;
|
|
import dev.plexapi.sdk.models.operations.MarkPlayedResponse;
|
|
import dev.plexapi.sdk.models.operations.MarkUnplayedResponse;
|
|
import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse;
|
|
import java.lang.Exception;
|
|
import org.junit.jupiter.api.Disabled;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public class MediaTests {
|
|
|
|
@Disabled // test marked as skipped for java or generated unit tests not production ready yet
|
|
@Test
|
|
public void testMedia_MarkPlayed() throws Exception {
|
|
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
MarkPlayedResponse res = sdk.media().markPlayed()
|
|
.key(59398d)
|
|
.call();
|
|
|
|
|
|
}
|
|
|
|
@Disabled // test marked as skipped for java or generated unit tests not production ready yet
|
|
@Test
|
|
public void testMedia_MarkUnplayed() throws Exception {
|
|
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
MarkUnplayedResponse res = sdk.media().markUnplayed()
|
|
.key(59398d)
|
|
.call();
|
|
|
|
|
|
}
|
|
|
|
@Disabled // test marked as skipped for java or generated unit tests not production ready yet
|
|
@Test
|
|
public void testMedia_UpdatePlayProgress_() throws Exception {
|
|
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.clientID("gcgzw5rz2xovp84b4vha3a40")
|
|
.clientName("Plex Web")
|
|
.clientVersion("4.133.0")
|
|
.clientPlatform("Chrome")
|
|
.deviceName("Linux")
|
|
.build();
|
|
|
|
UpdatePlayProgressResponse res = sdk.media().updatePlayProgress()
|
|
.key("<key>")
|
|
.time(90000d)
|
|
.state("played")
|
|
.call();
|
|
|
|
|
|
}
|
|
|
|
@Disabled // test marked as skipped for java or generated unit tests not production ready yet
|
|
@Test
|
|
public void testMedia_GetBannerImage() throws Exception {
|
|
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.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();
|
|
|
|
|
|
}
|
|
|
|
@Disabled // test marked as skipped for java or generated unit tests not production ready yet
|
|
@Test
|
|
public void testMedia_GetThumbImage() throws Exception {
|
|
|
|
|
|
PlexAPI sdk = PlexAPI.builder()
|
|
.accessToken("<YOUR_API_KEY_HERE>")
|
|
.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();
|
|
|
|
|
|
}
|
|
|
|
} |