mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.295.1
This commit is contained in:
@@ -13,6 +13,7 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [GetLibraries](#getlibraries) - Get All Libraries
|
||||
* [GetLibrary](#getlibrary) - Get Library Details
|
||||
* [DeleteLibrary](#deletelibrary) - Delete Library Section
|
||||
* [GetLibraryItems](#getlibraryitems) - Get Library Items
|
||||
* [RefreshLibrary](#refreshlibrary) - Refresh Library
|
||||
* [SearchLibrary](#searchlibrary) - Search Library
|
||||
* [GetMetadata](#getmetadata) - Get Items Metadata
|
||||
@@ -29,7 +30,6 @@ This resource returns hash values for local files
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -40,11 +40,9 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var url_ string = "file://C:\Image.png&type=13"
|
||||
|
||||
var type_ *float64 = plexgo.Float64(4462.17)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetFileHash(ctx, url_, type_)
|
||||
if err != nil {
|
||||
@@ -84,7 +82,6 @@ This endpoint will return the recently added content.
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -96,8 +93,6 @@ func main() {
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetRecentlyAdded(ctx)
|
||||
if err != nil {
|
||||
@@ -140,7 +135,6 @@ This allows a client to provide a rich interface around the media (e.g. allow so
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -152,8 +146,6 @@ func main() {
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetLibraries(ctx)
|
||||
if err != nil {
|
||||
@@ -229,7 +221,6 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
@@ -241,11 +232,9 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var sectionID float64 = 1000
|
||||
|
||||
var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer()
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetLibrary(ctx, sectionID, includeDetails)
|
||||
if err != nil {
|
||||
@@ -284,7 +273,6 @@ Delate a library using a specific section
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -295,9 +283,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var sectionID float64 = 1000
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.DeleteLibrary(ctx, sectionID)
|
||||
if err != nil {
|
||||
@@ -325,6 +311,78 @@ func main() {
|
||||
| sdkerrors.DeleteLibraryResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetLibraryItems
|
||||
|
||||
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
|
||||
- `all`: All items in the section.
|
||||
- `unwatched`: Items that have not been played.
|
||||
- `newest`: Items that are recently released.
|
||||
- `recentlyAdded`: Items that are recently added to the library.
|
||||
- `recentlyViewed`: Items that were recently viewed.
|
||||
- `onDeck`: Items to continue watching.
|
||||
- `collection`: Items categorized by collection.
|
||||
- `edition`: Items categorized by edition.
|
||||
- `genre`: Items categorized by genre.
|
||||
- `year`: Items categorized by year of release.
|
||||
- `decade`: Items categorized by decade.
|
||||
- `director`: Items categorized by director.
|
||||
- `actor`: Items categorized by starring actor.
|
||||
- `country`: Items categorized by country of origin.
|
||||
- `contentRating`: Items categorized by content rating.
|
||||
- `rating`: Items categorized by rating.
|
||||
- `resolution`: Items categorized by resolution.
|
||||
- `firstCharacter`: Items categorized by the first letter.
|
||||
- `folder`: Items categorized by folder.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
var sectionID int64 = 1
|
||||
|
||||
var tag operations.Tag = operations.TagGenre
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetLibraryItems(ctx, sectionID, tag)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `sectionID` | *int64* | :heavy_check_mark: | the Id of the library to query | 1 |
|
||||
| `tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[*operations.GetLibraryItemsResponse](../../models/operations/getlibraryitemsresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| sdkerrors.GetLibraryItemsResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## RefreshLibrary
|
||||
|
||||
This endpoint Refreshes the library.
|
||||
@@ -336,7 +394,6 @@ This endpoint Refreshes the library.
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -347,9 +404,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var sectionID float64 = 934.16
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.RefreshLibrary(ctx, sectionID)
|
||||
if err != nil {
|
||||
@@ -405,7 +460,6 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
@@ -417,11 +471,9 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var sectionID int64 = 933505
|
||||
|
||||
var type_ operations.Type = operations.TypeFour
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.SearchLibrary(ctx, sectionID, type_)
|
||||
if err != nil {
|
||||
@@ -445,9 +497,10 @@ func main() {
|
||||
### Response
|
||||
|
||||
**[*operations.SearchLibraryResponse](../../models/operations/searchlibraryresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------ | ------------------ | ------------------ |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||
| sdkerrors.SearchLibraryResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetMetadata
|
||||
|
||||
@@ -460,7 +513,6 @@ This endpoint will return the metadata of a library item specified with the rati
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -471,9 +523,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var ratingKey float64 = 8382.31
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetMetadata(ctx, ratingKey)
|
||||
if err != nil {
|
||||
@@ -512,7 +562,6 @@ This endpoint will return the children of of a library item specified with the r
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -523,9 +572,7 @@ func main() {
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
var ratingKey float64 = 1539.14
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetMetadataChildren(ctx, ratingKey)
|
||||
if err != nil {
|
||||
@@ -564,7 +611,6 @@ This endpoint will return the on deck content.
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
@@ -576,8 +622,6 @@ func main() {
|
||||
plexgo.WithXPlexClientIdentifier("Postman"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetOnDeck(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user