Files
plexgo/docs/sdks/hubs/README.md

178 lines
13 KiB
Markdown

# Hubs
(*Hubs*)
## Overview
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
### Available Operations
* [GetGlobalHubs](#getglobalhubs) - Get Global Hubs
* [GetRecentlyAdded](#getrecentlyadded) - Get Recently Added
* [GetLibraryHubs](#getlibraryhubs) - Get library specific hubs
## GetGlobalHubs
Get Global Hubs filtered by the parameters provided.
### Example Usage
```go
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Hubs.GetGlobalHubs(ctx, nil, nil)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. |
| `onlyTransient` | [*operations.OnlyTransient](../../models/operations/onlytransient.md) | :heavy_minus_sign: | 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). |
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. |
### Response
**[*operations.GetGlobalHubsResponse](../../models/operations/getglobalhubsresponse.md), error**
### Errors
| Error Type | Status Code | Content Type |
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
| sdkerrors.GetGlobalHubsBadRequest | 400 | application/json |
| sdkerrors.GetGlobalHubsUnauthorized | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
## GetRecentlyAdded
This endpoint will return the recently added content.
### Example Usage
```go
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Hubs.GetRecentlyAdded(ctx, operations.GetRecentlyAddedRequest{
ContentDirectoryID: 39486,
SectionID: plexgo.Int64(2),
Type: operations.TypeTvShow,
IncludeMeta: operations.IncludeMetaEnable.ToPointer(),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `request` | [operations.GetRecentlyAddedRequest](../../models/operations/getrecentlyaddedrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. |
### Response
**[*operations.GetRecentlyAddedResponse](../../models/operations/getrecentlyaddedresponse.md), error**
### Errors
| Error Type | Status Code | Content Type |
| ------------------ | ------------------ | ------------------ |
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |
## GetLibraryHubs
This endpoint will return a list of library specific hubs
### Example Usage
```go
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Hubs.GetLibraryHubs(ctx, 492.74, nil, nil)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query |
| `count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. |
| `onlyTransient` | [*operations.QueryParamOnlyTransient](../../models/operations/queryparamonlytransient.md) | :heavy_minus_sign: | 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). |
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. |
### Response
**[*operations.GetLibraryHubsResponse](../../models/operations/getlibraryhubsresponse.md), error**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------ | ------------------------------------ | ------------------------------------ |
| sdkerrors.GetLibraryHubsBadRequest | 400 | application/json |
| sdkerrors.GetLibraryHubsUnauthorized | 401 | application/json |
| sdkerrors.SDKError | 4XX, 5XX | \*/\* |