mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 12:37:47 +00:00
304 lines
10 KiB
Java
304 lines
10 KiB
Java
/*
|
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
*/
|
|
package dev.plexapi.sdk;
|
|
|
|
import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation;
|
|
import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation;
|
|
|
|
import dev.plexapi.sdk.models.operations.GetMediaProvidersRequest;
|
|
import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest;
|
|
import dev.plexapi.sdk.models.operations.async.GetAvailableClientsRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetAvailableClientsResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetDevicesRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetDevicesResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetMediaProvidersRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetMediaProvidersResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetMyPlexAccountRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetMyPlexAccountResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetResizedPhotoRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetResizedPhotoResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerIdentityRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerIdentityResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerListRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerListResponse;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerPreferencesRequestBuilder;
|
|
import dev.plexapi.sdk.models.operations.async.GetServerPreferencesResponse;
|
|
import dev.plexapi.sdk.operations.GetAvailableClients;
|
|
import dev.plexapi.sdk.operations.GetDevices;
|
|
import dev.plexapi.sdk.operations.GetMediaProviders;
|
|
import dev.plexapi.sdk.operations.GetMyPlexAccount;
|
|
import dev.plexapi.sdk.operations.GetResizedPhoto;
|
|
import dev.plexapi.sdk.operations.GetServerCapabilities;
|
|
import dev.plexapi.sdk.operations.GetServerIdentity;
|
|
import dev.plexapi.sdk.operations.GetServerList;
|
|
import dev.plexapi.sdk.operations.GetServerPreferences;
|
|
import java.lang.String;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
/**
|
|
* Operations against the Plex Media Server System.
|
|
*/
|
|
public class AsyncServer {
|
|
private final SDKConfiguration sdkConfiguration;
|
|
private final Server syncSDK;
|
|
|
|
AsyncServer(Server syncSDK, SDKConfiguration sdkConfiguration) {
|
|
this.sdkConfiguration = sdkConfiguration;
|
|
this.syncSDK = syncSDK;
|
|
}
|
|
|
|
/**
|
|
* Switches to the sync SDK.
|
|
*
|
|
* @return The sync SDK
|
|
*/
|
|
public Server sync() {
|
|
return syncSDK;
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Server Capabilities
|
|
*
|
|
* <p>Get Server Capabilities
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetServerCapabilitiesRequestBuilder getServerCapabilities() {
|
|
return new GetServerCapabilitiesRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Server Capabilities
|
|
*
|
|
* <p>Get Server Capabilities
|
|
*
|
|
* @return CompletableFuture<GetServerCapabilitiesResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetServerCapabilitiesResponse> getServerCapabilitiesDirect() {
|
|
AsyncRequestlessOperation<GetServerCapabilitiesResponse> operation
|
|
= new GetServerCapabilities.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Server Preferences
|
|
*
|
|
* <p>Get Server Preferences
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetServerPreferencesRequestBuilder getServerPreferences() {
|
|
return new GetServerPreferencesRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Server Preferences
|
|
*
|
|
* <p>Get Server Preferences
|
|
*
|
|
* @return CompletableFuture<GetServerPreferencesResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetServerPreferencesResponse> getServerPreferencesDirect() {
|
|
AsyncRequestlessOperation<GetServerPreferencesResponse> operation
|
|
= new GetServerPreferences.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Available Clients
|
|
*
|
|
* <p>Get Available Clients
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetAvailableClientsRequestBuilder getAvailableClients() {
|
|
return new GetAvailableClientsRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Available Clients
|
|
*
|
|
* <p>Get Available Clients
|
|
*
|
|
* @return CompletableFuture<GetAvailableClientsResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetAvailableClientsResponse> getAvailableClientsDirect() {
|
|
AsyncRequestlessOperation<GetAvailableClientsResponse> operation
|
|
= new GetAvailableClients.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Devices
|
|
*
|
|
* <p>Get Devices
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetDevicesRequestBuilder getDevices() {
|
|
return new GetDevicesRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Devices
|
|
*
|
|
* <p>Get Devices
|
|
*
|
|
* @return CompletableFuture<GetDevicesResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetDevicesResponse> getDevicesDirect() {
|
|
AsyncRequestlessOperation<GetDevicesResponse> operation
|
|
= new GetDevices.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Server Identity
|
|
*
|
|
* <p>This request is useful to determine if the server is online or offline
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetServerIdentityRequestBuilder getServerIdentity() {
|
|
return new GetServerIdentityRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Server Identity
|
|
*
|
|
* <p>This request is useful to determine if the server is online or offline
|
|
*
|
|
* @return CompletableFuture<GetServerIdentityResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetServerIdentityResponse> getServerIdentityDirect() {
|
|
AsyncRequestlessOperation<GetServerIdentityResponse> operation
|
|
= new GetServerIdentity.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get MyPlex Account
|
|
*
|
|
* <p>Returns MyPlex Account Information
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetMyPlexAccountRequestBuilder getMyPlexAccount() {
|
|
return new GetMyPlexAccountRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get MyPlex Account
|
|
*
|
|
* <p>Returns MyPlex Account Information
|
|
*
|
|
* @return CompletableFuture<GetMyPlexAccountResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetMyPlexAccountResponse> getMyPlexAccountDirect() {
|
|
AsyncRequestlessOperation<GetMyPlexAccountResponse> operation
|
|
= new GetMyPlexAccount.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get a Resized Photo
|
|
*
|
|
* <p>Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetResizedPhotoRequestBuilder getResizedPhoto() {
|
|
return new GetResizedPhotoRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get a Resized Photo
|
|
*
|
|
* <p>Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
|
|
*
|
|
* @param request The request object containing all the parameters for the API call.
|
|
* @return CompletableFuture<GetResizedPhotoResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetResizedPhotoResponse> getResizedPhoto(GetResizedPhotoRequest request) {
|
|
AsyncRequestOperation<GetResizedPhotoRequest, GetResizedPhotoResponse> operation
|
|
= new GetResizedPhoto.Async(sdkConfiguration);
|
|
return operation.doRequest(request)
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Media Providers
|
|
*
|
|
* <p>Retrieves media providers and their features from the Plex server.
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetMediaProvidersRequestBuilder getMediaProviders() {
|
|
return new GetMediaProvidersRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Media Providers
|
|
*
|
|
* <p>Retrieves media providers and their features from the Plex server.
|
|
*
|
|
* @param xPlexToken An authentication token, obtained from plex.tv
|
|
* @return CompletableFuture<GetMediaProvidersResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetMediaProvidersResponse> getMediaProviders(String xPlexToken) {
|
|
GetMediaProvidersRequest request =
|
|
GetMediaProvidersRequest
|
|
.builder()
|
|
.xPlexToken(xPlexToken)
|
|
.build();
|
|
AsyncRequestOperation<GetMediaProvidersRequest, GetMediaProvidersResponse> operation
|
|
= new GetMediaProviders.Async(sdkConfiguration);
|
|
return operation.doRequest(request)
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
|
|
/**
|
|
* Get Server List
|
|
*
|
|
* <p>Get Server List
|
|
*
|
|
* @return The async call builder
|
|
*/
|
|
public GetServerListRequestBuilder getServerList() {
|
|
return new GetServerListRequestBuilder(sdkConfiguration);
|
|
}
|
|
|
|
/**
|
|
* Get Server List
|
|
*
|
|
* <p>Get Server List
|
|
*
|
|
* @return CompletableFuture<GetServerListResponse> - The async response
|
|
*/
|
|
public CompletableFuture<GetServerListResponse> getServerListDirect() {
|
|
AsyncRequestlessOperation<GetServerListResponse> operation
|
|
= new GetServerList.Async(sdkConfiguration);
|
|
return operation.doRequest()
|
|
.thenCompose(operation::handleResponse);
|
|
}
|
|
|
|
}
|