From b3ac2d0c2e66f18dff0485894537dd5b2f808f18 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 23 Jan 2024 20:47:32 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.150.0 --- .speakeasy/gen.lock | 17 +- README.md | 1 + RELEASES.md | 12 +- .../operations/createplaylistrequest.md | 14 +- .../gettransienttokenqueryparamtype.md | 10 + .../operations/gettransienttokenrequest.md | 8 +- docs/models/operations/queryparamtype.md | 10 +- .../operations/searchlibrarymediacontainer.md | 20 + .../operations/searchlibrarymetadata.md | 27 ++ .../models/operations/searchlibraryrequest.md | 9 + .../operations/searchlibraryresponse.md | 11 + .../operations/searchlibraryresponsebody.md | 10 + docs/models/operations/tag.md | 43 +- docs/models/operations/type.md | 9 +- docs/sdks/library/README.md | 75 +++- docs/sdks/playlists/README.md | 2 +- docs/sdks/security/README.md | 12 +- gen.yaml | 2 +- library.go | 89 +++- models/operations/createplaylist.go | 24 +- models/operations/getlibraryitems.go | 41 +- models/operations/gettransienttoken.go | 20 +- models/operations/searchlibrary.go | 385 ++++++++++++++++++ plexapi.go | 4 +- security.go | 2 +- 25 files changed, 753 insertions(+), 104 deletions(-) create mode 100644 docs/models/operations/gettransienttokenqueryparamtype.md create mode 100644 docs/models/operations/searchlibrarymediacontainer.md create mode 100644 docs/models/operations/searchlibrarymetadata.md create mode 100644 docs/models/operations/searchlibraryrequest.md create mode 100644 docs/models/operations/searchlibraryresponse.md create mode 100644 docs/models/operations/searchlibraryresponsebody.md create mode 100644 models/operations/searchlibrary.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 48461e7..30a0fef 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 management: - docChecksum: 7aba498c024534142941d65a7c2e649c + docChecksum: 49e77b550f057eb568502dc74fee7cce docVersion: 0.0.3 speakeasyVersion: internal generationVersion: 2.237.3 - releaseVersion: 0.1.1 - configChecksum: 75ea35f7a212ecc077e24de582ed767e + releaseVersion: 0.1.2 + configChecksum: 6e7156b73170398db5f73b78a4f03b59 repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo @@ -83,6 +83,7 @@ generatedFiles: - /models/operations/deletelibrary.go - /models/operations/getlibraryitems.go - /models/operations/refreshlibrary.go + - /models/operations/searchlibrary.go - /models/operations/getmetadata.go - /models/operations/getmetadatachildren.go - /models/operations/getondeck.go @@ -308,6 +309,12 @@ generatedFiles: - docs/models/operations/getlibraryitemsresponse.md - docs/models/operations/refreshlibraryrequest.md - docs/models/operations/refreshlibraryresponse.md + - docs/models/operations/type.md + - docs/models/operations/searchlibraryrequest.md + - docs/models/operations/searchlibrarymetadata.md + - docs/models/operations/searchlibrarymediacontainer.md + - docs/models/operations/searchlibraryresponsebody.md + - docs/models/operations/searchlibraryresponse.md - docs/models/operations/getmetadatarequest.md - docs/models/operations/stream.md - docs/models/operations/getmetadatapart.md @@ -343,7 +350,7 @@ generatedFiles: - docs/models/operations/loglineresponse.md - docs/models/operations/logmultilineresponse.md - docs/models/operations/enablepapertrailresponse.md - - docs/models/operations/type.md + - docs/models/operations/queryparamtype.md - docs/models/operations/smart.md - docs/models/operations/createplaylistrequest.md - docs/models/operations/createplaylistmetadata.md @@ -388,7 +395,7 @@ generatedFiles: - docs/models/operations/force.md - docs/models/operations/uploadplaylistrequest.md - docs/models/operations/uploadplaylistresponse.md - - docs/models/operations/queryparamtype.md + - docs/models/operations/gettransienttokenqueryparamtype.md - docs/models/operations/scope.md - docs/models/operations/gettransienttokenrequest.md - docs/models/operations/gettransienttokenresponse.md diff --git a/README.md b/README.md index eb94726..627463f 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ func main() { * [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section * [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items * [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library +* [SearchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library * [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata * [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck diff --git a/RELEASES.md b/RELEASES.md index b95e406..1f9741c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -68,4 +68,14 @@ Based on: ### Generated - [go v0.1.1] . ### Releases -- [Go v0.1.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.1.1 - . \ No newline at end of file +- [Go v0.1.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.1.1 - . + +## 2024-01-23 20:47:20 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.150.0 (2.237.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.1.2] . +### Releases +- [Go v0.1.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.1.2 - . \ No newline at end of file diff --git a/docs/models/operations/createplaylistrequest.md b/docs/models/operations/createplaylistrequest.md index 5fbe4d7..53f347a 100644 --- a/docs/models/operations/createplaylistrequest.md +++ b/docs/models/operations/createplaylistrequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `Title` | *string* | :heavy_check_mark: | name of the playlist | -| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | type of playlist to create | -| `Smart` | [operations.Smart](../../models/operations/smart.md) | :heavy_check_mark: | whether the playlist is smart or not | -| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist | -| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to copy to a playlist | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Title` | *string* | :heavy_check_mark: | name of the playlist | +| `Type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | type of playlist to create | +| `Smart` | [operations.Smart](../../models/operations/smart.md) | :heavy_check_mark: | whether the playlist is smart or not | +| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist | +| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to copy to a playlist | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenqueryparamtype.md b/docs/models/operations/gettransienttokenqueryparamtype.md new file mode 100644 index 0000000..51acb40 --- /dev/null +++ b/docs/models/operations/gettransienttokenqueryparamtype.md @@ -0,0 +1,10 @@ +# GetTransientTokenQueryParamType + +`delegation` - This is the only supported `type` parameter. + + +## Values + +| Name | Value | +| ------------------------------------------- | ------------------------------------------- | +| `GetTransientTokenQueryParamTypeDelegation` | delegation | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenrequest.md b/docs/models/operations/gettransienttokenrequest.md index ab59f6d..bab3e19 100644 --- a/docs/models/operations/gettransienttokenrequest.md +++ b/docs/models/operations/gettransienttokenrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | -| `Scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `Type` | [operations.GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | +| `Scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | \ No newline at end of file diff --git a/docs/models/operations/queryparamtype.md b/docs/models/operations/queryparamtype.md index 20f3653..294587e 100644 --- a/docs/models/operations/queryparamtype.md +++ b/docs/models/operations/queryparamtype.md @@ -1,10 +1,12 @@ # QueryParamType -`delegation` - This is the only supported `type` parameter. +type of playlist to create ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `QueryParamTypeDelegation` | delegation | \ No newline at end of file +| Name | Value | +| --------------------- | --------------------- | +| `QueryParamTypeAudio` | audio | +| `QueryParamTypeVideo` | video | +| `QueryParamTypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/operations/searchlibrarymediacontainer.md b/docs/models/operations/searchlibrarymediacontainer.md new file mode 100644 index 0000000..3837916 --- /dev/null +++ b/docs/models/operations/searchlibrarymediacontainer.md @@ -0,0 +1,20 @@ +# SearchLibraryMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Size` | **int* | :heavy_minus_sign: | N/A | 2 | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false | +| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1698860922 | +| `Nocache` | **bool* | :heavy_minus_sign: | N/A | true | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/show.png | +| `Title1` | **string* | :heavy_minus_sign: | N/A | TV Shows | +| `Title2` | **string* | :heavy_minus_sign: | N/A | Search for '' | +| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | season | +| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65593 | +| `Metadata` | [][operations.SearchLibraryMetadata](../../models/operations/searchlibrarymetadata.md) | :heavy_minus_sign: | N/A | [{"addedAt":1705636916,"art":"/library/metadata/1/art/1705636920","guid":"plex://season/602e67e766dfdb002c0a1b5b","index":1,"key":"/library/metadata/2/children","parentGuid":"plex://show/5d9c086c7d06d9001ffd27aa","parentIndex":1,"parentKey":"/library/metadata/1","parentRatingKey":"1","parentStudio":"Mutant Enemy Productions","parentTheme":"/library/metadata/1/theme/1705636920","parentThumb":"/library/metadata/1/thumb/1705636920","parentTitle":"Firefly","parentYear":2002,"ratingKey":"2","summary":"Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship \"Serenity\". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government \"The Alliance\"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.","thumb":"/library/metadata/2/thumb/1705636920","title":"Season 1","type":"season","updatedAt":1705636920}] | \ No newline at end of file diff --git a/docs/models/operations/searchlibrarymetadata.md b/docs/models/operations/searchlibrarymetadata.md new file mode 100644 index 0000000..e1c809b --- /dev/null +++ b/docs/models/operations/searchlibrarymetadata.md @@ -0,0 +1,27 @@ +# SearchLibraryMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `RatingKey` | **string* | :heavy_minus_sign: | N/A | 2 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/2/children | +| `ParentRatingKey` | **string* | :heavy_minus_sign: | N/A | 1 | +| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://season/602e67e766dfdb002c0a1b5b | +| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c086c7d06d9001ffd27aa | +| `ParentStudio` | **string* | :heavy_minus_sign: | N/A | Mutant Enemy Productions | +| `Type` | **string* | :heavy_minus_sign: | N/A | season | +| `Title` | **string* | :heavy_minus_sign: | N/A | Season 1 | +| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1 | +| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Firefly | +| `Summary` | **string* | :heavy_minus_sign: | N/A | Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship "Serenity". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government "The Alliance"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space. | +| `Index` | **int* | :heavy_minus_sign: | N/A | 1 | +| `ParentIndex` | **int* | :heavy_minus_sign: | N/A | 1 | +| `ParentYear` | **int* | :heavy_minus_sign: | N/A | 2002 | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/2/thumb/1705636920 | +| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/art/1705636920 | +| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/thumb/1705636920 | +| `ParentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | +| `AddedAt` | **int* | :heavy_minus_sign: | N/A | 1705636916 | +| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705636920 | \ No newline at end of file diff --git a/docs/models/operations/searchlibraryrequest.md b/docs/models/operations/searchlibraryrequest.md new file mode 100644 index 0000000..273170b --- /dev/null +++ b/docs/models/operations/searchlibraryrequest.md @@ -0,0 +1,9 @@ +# SearchLibraryRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `SectionID` | *int64* | :heavy_check_mark: | the Id of the library to query | +| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | Plex content type to search for | \ No newline at end of file diff --git a/docs/models/operations/searchlibraryresponse.md b/docs/models/operations/searchlibraryresponse.md new file mode 100644 index 0000000..08d3a17 --- /dev/null +++ b/docs/models/operations/searchlibraryresponse.md @@ -0,0 +1,11 @@ +# SearchLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.SearchLibraryResponseBody](../../models/operations/searchlibraryresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file diff --git a/docs/models/operations/searchlibraryresponsebody.md b/docs/models/operations/searchlibraryresponsebody.md new file mode 100644 index 0000000..4de3cc8 --- /dev/null +++ b/docs/models/operations/searchlibraryresponsebody.md @@ -0,0 +1,10 @@ +# SearchLibraryResponseBody + +The contents of the library by section and type + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.SearchLibraryMediaContainer](../../models/operations/searchlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/tag.md b/docs/models/operations/tag.md index 5b7c3b1..b85428b 100644 --- a/docs/models/operations/tag.md +++ b/docs/models/operations/tag.md @@ -5,25 +5,24 @@ A key representing a specific tag within the section. ## Values -| Name | Value | -| --------------------- | --------------------- | -| `TagAll` | all | -| `TagUnwatched` | unwatched | -| `TagNewest` | newest | -| `TagRecentlyAdded` | recentlyAdded | -| `TagRecentlyViewed` | recentlyViewed | -| `TagOnDeck` | onDeck | -| `TagCollection` | collection | -| `TagEdition` | edition | -| `TagGenre` | genre | -| `TagYear` | year | -| `TagDecade` | decade | -| `TagDirector` | director | -| `TagActor` | actor | -| `TagCountry` | country | -| `TagContentRating` | contentRating | -| `TagRating` | rating | -| `TagResolution` | resolution | -| `TagFirstCharacter` | firstCharacter | -| `TagFolder` | folder | -| `TagSearchTypeEqual1` | search?type=1 | \ No newline at end of file +| Name | Value | +| ------------------- | ------------------- | +| `TagAll` | all | +| `TagUnwatched` | unwatched | +| `TagNewest` | newest | +| `TagRecentlyAdded` | recentlyAdded | +| `TagRecentlyViewed` | recentlyViewed | +| `TagOnDeck` | onDeck | +| `TagCollection` | collection | +| `TagEdition` | edition | +| `TagGenre` | genre | +| `TagYear` | year | +| `TagDecade` | decade | +| `TagDirector` | director | +| `TagActor` | actor | +| `TagCountry` | country | +| `TagContentRating` | contentRating | +| `TagRating` | rating | +| `TagResolution` | resolution | +| `TagFirstCharacter` | firstCharacter | +| `TagFolder` | folder | \ No newline at end of file diff --git a/docs/models/operations/type.md b/docs/models/operations/type.md index ecf08d5..bd68927 100644 --- a/docs/models/operations/type.md +++ b/docs/models/operations/type.md @@ -1,12 +1,13 @@ # Type -type of playlist to create +Plex content type to search for ## Values | Name | Value | | ----------- | ----------- | -| `TypeAudio` | audio | -| `TypeVideo` | video | -| `TypePhoto` | photo | \ No newline at end of file +| `TypeOne` | 1 | +| `TypeTwo` | 2 | +| `TypeThree` | 3 | +| `TypeFour` | 4 | \ No newline at end of file diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 6dc7036..ba072c0 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -15,6 +15,7 @@ API Calls interacting with Plex Media Server Libraries * [DeleteLibrary](#deletelibrary) - Delete Library Section * [GetLibraryItems](#getlibraryitems) - Get Library Items * [RefreshLibrary](#refreshlibrary) - Refresh Library +* [SearchLibrary](#searchlibrary) - Search Library * [GetMetadata](#getmetadata) - Get Items Metadata * [GetMetadataChildren](#getmetadatachildren) - Get Items Children * [GetOnDeck](#getondeck) - Get On Deck @@ -348,7 +349,6 @@ Fetches details from a specific section of the library identified by a section k - `resolution`: Items categorized by resolution. - `firstCharacter`: Items categorized by the first letter. - `folder`: Items categorized by folder. -- `search?type=1`: Search functionality within the section. ### Example Usage @@ -456,6 +456,79 @@ func main() { | sdkerrors.RefreshLibraryResponseBody | 401 | application/json | | sdkerrors.SDKError | 4xx-5xx | */* | +## SearchLibrary + +Search for content within a specific section of the library. + +### Types +Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + +- **Type Object Attributes**: + - `type`: Metadata type (if standard Plex type). + - `title`: Title for this content type (e.g., "Movies"). + +- **Filter Objects**: + - Subset of the media query language. + - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + +- **Sort Objects**: + - Description of sort fields. + - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + +> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID int64 = 933505 + + var type_ operations.Type = operations.TypeFour + + ctx := context.Background() + res, err := s.Library.SearchLibrary(ctx, sectionID, type_) + 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` | *int64* | :heavy_check_mark: | the Id of the library to query | +| `type_` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | Plex content type to search for | + + +### Response + +**[*operations.SearchLibraryResponse](../../models/operations/searchlibraryresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | + ## GetMetadata This endpoint will return the metadata of a library item specified with the ratingKey. diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index f8da910..e6b80d8 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -49,7 +49,7 @@ func main() { ctx := context.Background() res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ Title: "string", - Type: operations.TypePhoto, + Type: operations.QueryParamTypePhoto, Smart: operations.SmartOne, URI: "https://inborn-brochure.biz", }) diff --git a/docs/sdks/security/README.md b/docs/sdks/security/README.md index 24e23af..0477217 100644 --- a/docs/sdks/security/README.md +++ b/docs/sdks/security/README.md @@ -36,7 +36,7 @@ func main() { ) - var type_ operations.QueryParamType = operations.QueryParamTypeDelegation + var type_ operations.GetTransientTokenQueryParamType = operations.GetTransientTokenQueryParamTypeDelegation var scope operations.Scope = operations.ScopeAll @@ -54,11 +54,11 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `type_` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | -| `scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `type_` | [operations.GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | +| `scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | ### Response diff --git a/gen.yaml b/gen.yaml index 646ce53..47bcdf0 100644 --- a/gen.yaml +++ b/gen.yaml @@ -8,7 +8,7 @@ generation: fixes: nameResolutionDec2023: false go: - version: 0.1.1 + version: 0.1.2 clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true imports: diff --git a/library.go b/library.go index 2d4a012..e54da54 100644 --- a/library.go +++ b/library.go @@ -465,7 +465,6 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operat // - `resolution`: Items categorized by resolution. // - `firstCharacter`: Items categorized by the first letter. // - `folder`: Items categorized by folder. -// - `search?type=1`: Search functionality within the section. func (s *Library) GetLibraryItems(ctx context.Context, sectionID int64, tag operations.Tag) (*operations.GetLibraryItemsResponse, error) { request := operations.GetLibraryItemsRequest{ SectionID: sectionID, @@ -601,6 +600,94 @@ func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*opera return res, nil } +// SearchLibrary - Search Library +// Search for content within a specific section of the library. +// +// ### Types +// Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: +// +// - **Type Object Attributes**: +// - `type`: Metadata type (if standard Plex type). +// - `title`: Title for this content type (e.g., "Movies"). +// +// - **Filter Objects**: +// - Subset of the media query language. +// - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. +// +// - **Sort Objects**: +// - Description of sort fields. +// - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. +// +// > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. +func (s *Library) SearchLibrary(ctx context.Context, sectionID int64, type_ operations.Type) (*operations.SearchLibraryResponse, error) { + request := operations.SearchLibraryRequest{ + SectionID: sectionID, + Type: type_, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/search", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.SearchLibraryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.SearchLibraryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil +} + // GetMetadata - Get Items Metadata // This endpoint will return the metadata of a library item specified with the ratingKey. func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operations.GetMetadataResponse, error) { diff --git a/models/operations/createplaylist.go b/models/operations/createplaylist.go index e2ffd3a..ad26562 100644 --- a/models/operations/createplaylist.go +++ b/models/operations/createplaylist.go @@ -8,20 +8,20 @@ import ( "net/http" ) -// Type - type of playlist to create -type Type string +// QueryParamType - type of playlist to create +type QueryParamType string const ( - TypeAudio Type = "audio" - TypeVideo Type = "video" - TypePhoto Type = "photo" + QueryParamTypeAudio QueryParamType = "audio" + QueryParamTypeVideo QueryParamType = "video" + QueryParamTypePhoto QueryParamType = "photo" ) -func (e Type) ToPointer() *Type { +func (e QueryParamType) ToPointer() *QueryParamType { return &e } -func (e *Type) UnmarshalJSON(data []byte) error { +func (e *QueryParamType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -32,10 +32,10 @@ func (e *Type) UnmarshalJSON(data []byte) error { case "video": fallthrough case "photo": - *e = Type(v) + *e = QueryParamType(v) return nil default: - return fmt.Errorf("invalid value for Type: %v", v) + return fmt.Errorf("invalid value for QueryParamType: %v", v) } } @@ -71,7 +71,7 @@ type CreatePlaylistRequest struct { // name of the playlist Title string `queryParam:"style=form,explode=true,name=title"` // type of playlist to create - Type Type `queryParam:"style=form,explode=true,name=type"` + Type QueryParamType `queryParam:"style=form,explode=true,name=type"` // whether the playlist is smart or not Smart Smart `queryParam:"style=form,explode=true,name=smart"` // the content URI for the playlist @@ -87,9 +87,9 @@ func (o *CreatePlaylistRequest) GetTitle() string { return o.Title } -func (o *CreatePlaylistRequest) GetType() Type { +func (o *CreatePlaylistRequest) GetType() QueryParamType { if o == nil { - return Type("") + return QueryParamType("") } return o.Type } diff --git a/models/operations/getlibraryitems.go b/models/operations/getlibraryitems.go index 28061e7..20a69d0 100644 --- a/models/operations/getlibraryitems.go +++ b/models/operations/getlibraryitems.go @@ -14,26 +14,25 @@ import ( type Tag string const ( - TagAll Tag = "all" - TagUnwatched Tag = "unwatched" - TagNewest Tag = "newest" - TagRecentlyAdded Tag = "recentlyAdded" - TagRecentlyViewed Tag = "recentlyViewed" - TagOnDeck Tag = "onDeck" - TagCollection Tag = "collection" - TagEdition Tag = "edition" - TagGenre Tag = "genre" - TagYear Tag = "year" - TagDecade Tag = "decade" - TagDirector Tag = "director" - TagActor Tag = "actor" - TagCountry Tag = "country" - TagContentRating Tag = "contentRating" - TagRating Tag = "rating" - TagResolution Tag = "resolution" - TagFirstCharacter Tag = "firstCharacter" - TagFolder Tag = "folder" - TagSearchTypeEqual1 Tag = "search?type=1" + TagAll Tag = "all" + TagUnwatched Tag = "unwatched" + TagNewest Tag = "newest" + TagRecentlyAdded Tag = "recentlyAdded" + TagRecentlyViewed Tag = "recentlyViewed" + TagOnDeck Tag = "onDeck" + TagCollection Tag = "collection" + TagEdition Tag = "edition" + TagGenre Tag = "genre" + TagYear Tag = "year" + TagDecade Tag = "decade" + TagDirector Tag = "director" + TagActor Tag = "actor" + TagCountry Tag = "country" + TagContentRating Tag = "contentRating" + TagRating Tag = "rating" + TagResolution Tag = "resolution" + TagFirstCharacter Tag = "firstCharacter" + TagFolder Tag = "folder" ) func (e Tag) ToPointer() *Tag { @@ -83,8 +82,6 @@ func (e *Tag) UnmarshalJSON(data []byte) error { case "firstCharacter": fallthrough case "folder": - fallthrough - case "search?type=1": *e = Tag(v) return nil default: diff --git a/models/operations/gettransienttoken.go b/models/operations/gettransienttoken.go index 03d2843..65bcebb 100644 --- a/models/operations/gettransienttoken.go +++ b/models/operations/gettransienttoken.go @@ -8,28 +8,28 @@ import ( "net/http" ) -// QueryParamType - `delegation` - This is the only supported `type` parameter. -type QueryParamType string +// GetTransientTokenQueryParamType - `delegation` - This is the only supported `type` parameter. +type GetTransientTokenQueryParamType string const ( - QueryParamTypeDelegation QueryParamType = "delegation" + GetTransientTokenQueryParamTypeDelegation GetTransientTokenQueryParamType = "delegation" ) -func (e QueryParamType) ToPointer() *QueryParamType { +func (e GetTransientTokenQueryParamType) ToPointer() *GetTransientTokenQueryParamType { return &e } -func (e *QueryParamType) UnmarshalJSON(data []byte) error { +func (e *GetTransientTokenQueryParamType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "delegation": - *e = QueryParamType(v) + *e = GetTransientTokenQueryParamType(v) return nil default: - return fmt.Errorf("invalid value for QueryParamType: %v", v) + return fmt.Errorf("invalid value for GetTransientTokenQueryParamType: %v", v) } } @@ -60,14 +60,14 @@ func (e *Scope) UnmarshalJSON(data []byte) error { type GetTransientTokenRequest struct { // `delegation` - This is the only supported `type` parameter. - Type QueryParamType `queryParam:"style=form,explode=true,name=type"` + Type GetTransientTokenQueryParamType `queryParam:"style=form,explode=true,name=type"` // `all` - This is the only supported `scope` parameter. Scope Scope `queryParam:"style=form,explode=true,name=scope"` } -func (o *GetTransientTokenRequest) GetType() QueryParamType { +func (o *GetTransientTokenRequest) GetType() GetTransientTokenQueryParamType { if o == nil { - return QueryParamType("") + return GetTransientTokenQueryParamType("") } return o.Type } diff --git a/models/operations/searchlibrary.go b/models/operations/searchlibrary.go new file mode 100644 index 0000000..79b7cac --- /dev/null +++ b/models/operations/searchlibrary.go @@ -0,0 +1,385 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Type - Plex content type to search for +type Type int64 + +const ( + TypeOne Type = 1 + TypeTwo Type = 2 + TypeThree Type = 3 + TypeFour Type = 4 +) + +func (e Type) ToPointer() *Type { + return &e +} + +func (e *Type) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 1: + fallthrough + case 2: + fallthrough + case 3: + fallthrough + case 4: + *e = Type(v) + return nil + default: + return fmt.Errorf("invalid value for Type: %v", v) + } +} + +type SearchLibraryRequest struct { + // the Id of the library to query + SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Plex content type to search for + Type Type `queryParam:"style=form,explode=true,name=type"` +} + +func (o *SearchLibraryRequest) GetSectionID() int64 { + if o == nil { + return 0 + } + return o.SectionID +} + +func (o *SearchLibraryRequest) GetType() Type { + if o == nil { + return Type(0) + } + return o.Type +} + +type SearchLibraryMetadata struct { + RatingKey *string `json:"ratingKey,omitempty"` + Key *string `json:"key,omitempty"` + ParentRatingKey *string `json:"parentRatingKey,omitempty"` + GUID *string `json:"guid,omitempty"` + ParentGUID *string `json:"parentGuid,omitempty"` + ParentStudio *string `json:"parentStudio,omitempty"` + Type *string `json:"type,omitempty"` + Title *string `json:"title,omitempty"` + ParentKey *string `json:"parentKey,omitempty"` + ParentTitle *string `json:"parentTitle,omitempty"` + Summary *string `json:"summary,omitempty"` + Index *int `json:"index,omitempty"` + ParentIndex *int `json:"parentIndex,omitempty"` + ParentYear *int `json:"parentYear,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Art *string `json:"art,omitempty"` + ParentThumb *string `json:"parentThumb,omitempty"` + ParentTheme *string `json:"parentTheme,omitempty"` + AddedAt *int `json:"addedAt,omitempty"` + UpdatedAt *int `json:"updatedAt,omitempty"` +} + +func (o *SearchLibraryMetadata) GetRatingKey() *string { + if o == nil { + return nil + } + return o.RatingKey +} + +func (o *SearchLibraryMetadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *SearchLibraryMetadata) GetParentRatingKey() *string { + if o == nil { + return nil + } + return o.ParentRatingKey +} + +func (o *SearchLibraryMetadata) GetGUID() *string { + if o == nil { + return nil + } + return o.GUID +} + +func (o *SearchLibraryMetadata) GetParentGUID() *string { + if o == nil { + return nil + } + return o.ParentGUID +} + +func (o *SearchLibraryMetadata) GetParentStudio() *string { + if o == nil { + return nil + } + return o.ParentStudio +} + +func (o *SearchLibraryMetadata) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *SearchLibraryMetadata) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *SearchLibraryMetadata) GetParentKey() *string { + if o == nil { + return nil + } + return o.ParentKey +} + +func (o *SearchLibraryMetadata) GetParentTitle() *string { + if o == nil { + return nil + } + return o.ParentTitle +} + +func (o *SearchLibraryMetadata) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *SearchLibraryMetadata) GetIndex() *int { + if o == nil { + return nil + } + return o.Index +} + +func (o *SearchLibraryMetadata) GetParentIndex() *int { + if o == nil { + return nil + } + return o.ParentIndex +} + +func (o *SearchLibraryMetadata) GetParentYear() *int { + if o == nil { + return nil + } + return o.ParentYear +} + +func (o *SearchLibraryMetadata) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *SearchLibraryMetadata) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *SearchLibraryMetadata) GetParentThumb() *string { + if o == nil { + return nil + } + return o.ParentThumb +} + +func (o *SearchLibraryMetadata) GetParentTheme() *string { + if o == nil { + return nil + } + return o.ParentTheme +} + +func (o *SearchLibraryMetadata) GetAddedAt() *int { + if o == nil { + return nil + } + return o.AddedAt +} + +func (o *SearchLibraryMetadata) GetUpdatedAt() *int { + if o == nil { + return nil + } + return o.UpdatedAt +} + +type SearchLibraryMediaContainer struct { + Size *int `json:"size,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Art *string `json:"art,omitempty"` + Identifier *string `json:"identifier,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *int `json:"mediaTagVersion,omitempty"` + Nocache *bool `json:"nocache,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Title1 *string `json:"title1,omitempty"` + Title2 *string `json:"title2,omitempty"` + ViewGroup *string `json:"viewGroup,omitempty"` + ViewMode *int `json:"viewMode,omitempty"` + Metadata []SearchLibraryMetadata `json:"Metadata,omitempty"` +} + +func (o *SearchLibraryMediaContainer) GetSize() *int { + if o == nil { + return nil + } + return o.Size +} + +func (o *SearchLibraryMediaContainer) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *SearchLibraryMediaContainer) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *SearchLibraryMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *SearchLibraryMediaContainer) GetMediaTagPrefix() *string { + if o == nil { + return nil + } + return o.MediaTagPrefix +} + +func (o *SearchLibraryMediaContainer) GetMediaTagVersion() *int { + if o == nil { + return nil + } + return o.MediaTagVersion +} + +func (o *SearchLibraryMediaContainer) GetNocache() *bool { + if o == nil { + return nil + } + return o.Nocache +} + +func (o *SearchLibraryMediaContainer) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *SearchLibraryMediaContainer) GetTitle1() *string { + if o == nil { + return nil + } + return o.Title1 +} + +func (o *SearchLibraryMediaContainer) GetTitle2() *string { + if o == nil { + return nil + } + return o.Title2 +} + +func (o *SearchLibraryMediaContainer) GetViewGroup() *string { + if o == nil { + return nil + } + return o.ViewGroup +} + +func (o *SearchLibraryMediaContainer) GetViewMode() *int { + if o == nil { + return nil + } + return o.ViewMode +} + +func (o *SearchLibraryMediaContainer) GetMetadata() []SearchLibraryMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +// SearchLibraryResponseBody - The contents of the library by section and type +type SearchLibraryResponseBody struct { + MediaContainer *SearchLibraryMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *SearchLibraryResponseBody) GetMediaContainer() *SearchLibraryMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type SearchLibraryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The contents of the library by section and type + Object *SearchLibraryResponseBody +} + +func (o *SearchLibraryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *SearchLibraryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *SearchLibraryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *SearchLibraryResponse) GetObject() *SearchLibraryResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/plexapi.go b/plexapi.go index 670b452..fa26cca 100644 --- a/plexapi.go +++ b/plexapi.go @@ -251,9 +251,9 @@ func New(opts ...SDKOption) *PlexAPI { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.3", - SDKVersion: "0.1.1", + SDKVersion: "0.1.2", GenVersion: "2.237.3", - UserAgent: "speakeasy-sdk/go 0.1.1 2.237.3 0.0.3 github.com/LukeHagar/plexgo", + UserAgent: "speakeasy-sdk/go 0.1.2 2.237.3 0.0.3 github.com/LukeHagar/plexgo", ServerDefaults: []map[string]string{ { "protocol": "http", diff --git a/security.go b/security.go index 7515fb9..e08e07d 100644 --- a/security.go +++ b/security.go @@ -27,7 +27,7 @@ func newSecurity(sdkConfig sdkConfiguration) *Security { // GetTransientToken - Get a Transient Token. // This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. -func (s *Security) GetTransientToken(ctx context.Context, type_ operations.QueryParamType, scope operations.Scope) (*operations.GetTransientTokenResponse, error) { +func (s *Security) GetTransientToken(ctx context.Context, type_ operations.GetTransientTokenQueryParamType, scope operations.Scope) (*operations.GetTransientTokenResponse, error) { request := operations.GetTransientTokenRequest{ Type: type_, Scope: scope,