mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-07 04:20:49 +00:00
94 lines
3.1 KiB
Java
94 lines
3.1 KiB
Java
/*
|
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
*/
|
|
package dev.plexapi.sdk;
|
|
|
|
import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation;
|
|
|
|
import dev.plexapi.sdk.models.operations.GetTimelineRequest;
|
|
import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest;
|
|
import dev.plexapi.sdk.models.operations.async.GetTimelineRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetTimelineResponse;
|
|
import dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeResponse;
|
|
import dev.plexapi.sdk.operations.GetTimeline;
|
|
import dev.plexapi.sdk.operations.StartUniversalTranscode;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
/**
|
|
* API Calls that perform operations with Plex Media Server Videos
|
|
*/
|
|
public class AsyncVideo {
|
|
private final SDKConfiguration sdkConfiguration;
|
|
private final Video syncSDK;
|
|
|
|
AsyncVideo(Video syncSDK, SDKConfiguration sdkConfiguration) {
|
|
this.sdkConfiguration = sdkConfiguration;
|
|
this.syncSDK = syncSDK;
|
|
}
|
|
|
|
/**
|
|
* Switches to the sync SDK.
|
|
*
|
|
* @return The sync SDK
|
|
*/
|
|
public Video sync() {
|
|
return syncSDK;
|
|
}
|
|
|
|
|
|
/**
|
|
* Get the timeline for a media item
|
|
*
|
|
* <p>Get the timeline for a media item
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetTimelineRequestBuilder getTimeline() {
|
|
return new GetTimelineRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get the timeline for a media item
|
|
*
|
|
* <p>Get the timeline for a media item
|
|
*
|
|
* @param request The request object containing all the parameters for the API call.
|
|
* @return CompletableFuture<GetTimelineResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetTimelineResponse> getTimeline(GetTimelineRequest request) {
|
|
AsyncRequestOperation<GetTimelineRequest, GetTimelineResponse> operation
|
|
= new GetTimeline.Async(sdkConfiguration);
|
|
return operation.doRequest(request)
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Start Universal Transcode
|
|
*
|
|
* <p>Begin a Universal Transcode Session
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public StartUniversalTranscodeRequestBuilder startUniversalTranscode() {
|
|
return new StartUniversalTranscodeRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Start Universal Transcode
|
|
*
|
|
* <p>Begin a Universal Transcode Session
|
|
*
|
|
* @param request The request object containing all the parameters for the API call.
|
|
* @return CompletableFuture<StartUniversalTranscodeResponse> - The async response
|
|
*/
|
|
public CompletableFuture<StartUniversalTranscodeResponse> startUniversalTranscode(StartUniversalTranscodeRequest request) {
|
|
AsyncRequestOperation<StartUniversalTranscodeRequest, StartUniversalTranscodeResponse> operation
|
|
= new StartUniversalTranscode.Async(sdkConfiguration);
|
|
return operation.doRequest(request)
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
}
|