mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 04:20:46 +00:00
10 KiB
10 KiB
Hubs
(hubs())
Overview
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
Available Operations
- getGlobalHubs - Get Global Hubs
- getLibraryHubs - Get library specific hubs
getGlobalHubs
Get Global Hubs filtered by the parameters provided.
Example Usage
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;
public class Application {
public static void main(String[] args) throws Exception {
try {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.xPlexClientIdentifier("Postman")
.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;
}
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
count |
Optional<? extends Double> | ➖ | The number of items to return with each hub. |
onlyTransient |
Optional<? extends lukehagar.plexapi.plexapi.models.operations.OnlyTransient> | ➖ | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
Response
lukehagar.plexapi.plexapi.models.operations.GetGlobalHubsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| models/errors/GetGlobalHubsResponseBody | 401 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |
getLibraryHubs
This endpoint will return a list of library specific hubs
Example Usage
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;
public class Application {
public static void main(String[] args) throws Exception {
try {
PlexAPI sdk = PlexAPI.builder()
.accessToken("<YOUR_API_KEY_HERE>")
.xPlexClientIdentifier("Postman")
.build();
GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs()
.sectionId(6728.76d)
.count(9010.22d)
.onlyTransient(QueryParamOnlyTransient.ZERO)
.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;
}
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sectionId |
double | ✔️ | the Id of the library to query |
count |
Optional<? extends Double> | ➖ | The number of items to return with each hub. |
onlyTransient |
Optional<? extends lukehagar.plexapi.plexapi.models.operations.QueryParamOnlyTransient> | ➖ | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
Response
lukehagar.plexapi.plexapi.models.operations.GetLibraryHubsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| models/errors/GetLibraryHubsResponseBody | 401 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |