From 70d2e2a152a9bafd86776b6046db6ef515878e90 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 20 Jan 2024 03:10:30 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.148.0 --- .speakeasy/gen.lock | 20 +- RELEASES.md | 12 +- docs/models/operations/field.md | 11 + docs/models/operations/fieldtype.md | 9 + docs/models/operations/filter.md | 12 + docs/models/operations/getlibrarydirectory.md | 6 +- .../operations/getlibrarymediacontainer.md | 32 ++- docs/models/operations/getlibrarytype.md | 14 + .../getserverpreferencesmediacontainer.md | 9 + .../getserverpreferencesresponse.md | 11 +- .../getserverpreferencesresponsebody.md | 10 + docs/models/operations/one.md | 16 ++ docs/models/operations/operator.md | 9 + docs/models/operations/setting.md | 17 ++ docs/models/operations/sort.md | 13 + docs/models/operations/two.md | 17 ++ docs/sdks/server/README.md | 3 +- gen.yaml | 2 +- models/operations/getlibrary.go | 250 ++++++++++++++++- models/operations/getserverpreferences.go | 263 ++++++++++++++++++ plexapi.go | 6 +- server.go | 11 + 22 files changed, 715 insertions(+), 38 deletions(-) create mode 100644 docs/models/operations/field.md create mode 100644 docs/models/operations/fieldtype.md create mode 100644 docs/models/operations/filter.md create mode 100644 docs/models/operations/getlibrarytype.md create mode 100644 docs/models/operations/getserverpreferencesmediacontainer.md create mode 100644 docs/models/operations/getserverpreferencesresponsebody.md create mode 100644 docs/models/operations/one.md create mode 100644 docs/models/operations/operator.md create mode 100644 docs/models/operations/setting.md create mode 100644 docs/models/operations/sort.md create mode 100644 docs/models/operations/two.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9f1295e..a899f27 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: a14d0ae27d4f5bd83b80747112f74352 + docChecksum: 1e8e82037a237e1d1467721fbd2c7ab0 docVersion: 0.0.3 speakeasyVersion: internal - generationVersion: 2.237.2 - releaseVersion: 0.0.5 - configChecksum: 5b3127b5f000f6d96e7a3e6ea5fc06e9 + generationVersion: 2.237.3 + releaseVersion: 0.1.0 + configChecksum: 73d3c85671a6bde12c0c56fe7e1dc772 repoURL: https://github.com/LukeHagar/plexgo.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexgo @@ -19,6 +19,7 @@ features: globalSecurity: 2.82.4 globalServerURLs: 2.82.1 nameOverrides: 2.81.1 + unions: 2.85.2 generatedFiles: - server.go - media.go @@ -173,6 +174,11 @@ generatedFiles: - docs/models/operations/mediacontainer.md - docs/models/operations/getservercapabilitiesresponsebody.md - docs/models/operations/getservercapabilitiesresponse.md + - docs/models/operations/two.md + - docs/models/operations/one.md + - docs/models/operations/setting.md + - docs/models/operations/getserverpreferencesmediacontainer.md + - docs/models/operations/getserverpreferencesresponsebody.md - docs/models/operations/getserverpreferencesresponse.md - docs/models/operations/server.md - docs/models/operations/getavailableclientsmediacontainer.md @@ -265,6 +271,12 @@ generatedFiles: - docs/models/operations/includedetails.md - docs/models/operations/getlibraryrequest.md - docs/models/operations/getlibrarydirectory.md + - docs/models/operations/filter.md + - docs/models/operations/sort.md + - docs/models/operations/field.md + - docs/models/operations/getlibrarytype.md + - docs/models/operations/operator.md + - docs/models/operations/fieldtype.md - docs/models/operations/getlibrarymediacontainer.md - docs/models/operations/getlibraryresponsebody.md - docs/models/operations/getlibraryresponse.md diff --git a/RELEASES.md b/RELEASES.md index 94875a5..7072600 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -48,4 +48,14 @@ Based on: ### Generated - [go v0.0.5] . ### Releases -- [Go v0.0.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.5 - . \ No newline at end of file +- [Go v0.0.5] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.5 - . + +## 2024-01-20 03:10:19 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.148.0 (2.237.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.1.0] . +### Releases +- [Go v0.1.0] https://github.com/LukeHagar/plexgo/releases/tag/v0.1.0 - . \ No newline at end of file diff --git a/docs/models/operations/field.md b/docs/models/operations/field.md new file mode 100644 index 0000000..879a3cd --- /dev/null +++ b/docs/models/operations/field.md @@ -0,0 +1,11 @@ +# Field + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | label | +| `Title` | **string* | :heavy_minus_sign: | N/A | Label | +| `Type` | **string* | :heavy_minus_sign: | N/A | tag | +| `SubType` | **string* | :heavy_minus_sign: | N/A | bitrate | \ No newline at end of file diff --git a/docs/models/operations/fieldtype.md b/docs/models/operations/fieldtype.md new file mode 100644 index 0000000..e0a6653 --- /dev/null +++ b/docs/models/operations/fieldtype.md @@ -0,0 +1,9 @@ +# FieldType + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Type` | **string* | :heavy_minus_sign: | N/A | resolution | +| `Operator` | [][operations.Operator](../../models/operations/operator.md) | :heavy_minus_sign: | N/A | [{"key":"=","title":"is"}] | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md new file mode 100644 index 0000000..007011b --- /dev/null +++ b/docs/models/operations/filter.md @@ -0,0 +1,12 @@ +# Filter + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `Filter` | **string* | :heavy_minus_sign: | N/A | label | +| `FilterType` | **string* | :heavy_minus_sign: | N/A | string | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/label | +| `Title` | **string* | :heavy_minus_sign: | N/A | Labels | +| `Type` | **string* | :heavy_minus_sign: | N/A | filter | \ No newline at end of file diff --git a/docs/models/operations/getlibrarydirectory.md b/docs/models/operations/getlibrarydirectory.md index 66630e7..917091f 100644 --- a/docs/models/operations/getlibrarydirectory.md +++ b/docs/models/operations/getlibrarydirectory.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | search?type=1 | +| `Title` | **string* | :heavy_minus_sign: | N/A | Search... | | `Secondary` | **bool* | :heavy_minus_sign: | N/A | true | | `Prompt` | **string* | :heavy_minus_sign: | N/A | Search Movies | -| `Search` | **bool* | :heavy_minus_sign: | N/A | true | -| `Key` | **string* | :heavy_minus_sign: | N/A | search?type=1 | -| `Title` | **string* | :heavy_minus_sign: | N/A | Search... | \ No newline at end of file +| `Search` | **bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/models/operations/getlibrarymediacontainer.md b/docs/models/operations/getlibrarymediacontainer.md index 670cbc6..cd569e7 100644 --- a/docs/models/operations/getlibrarymediacontainer.md +++ b/docs/models/operations/getlibrarymediacontainer.md @@ -3,18 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `Size` | **int* | :heavy_minus_sign: | N/A | 20 | -| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false | -| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `Content` | **string* | :heavy_minus_sign: | N/A | secondary | -| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | -| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1698860922 | -| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `Title1` | **string* | :heavy_minus_sign: | N/A | Movies | -| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | secondary | -| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 | -| `Directory` | [][operations.GetLibraryDirectory](../../models/operations/getlibrarydirectory.md) | :heavy_minus_sign: | N/A | [{"key":"search?type=1","prompt":"Search Movies","search":true,"secondary":true,"title":"Search..."}] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Size` | **int* | :heavy_minus_sign: | N/A | 29 | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false | +| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | +| `Content` | **string* | :heavy_minus_sign: | N/A | secondary | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `LibrarySectionID` | **int* | :heavy_minus_sign: | N/A | 1 | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `MediaTagVersion` | **int* | :heavy_minus_sign: | N/A | 1701731894 | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie.png | +| `Title1` | **string* | :heavy_minus_sign: | N/A | Movies | +| `ViewGroup` | **string* | :heavy_minus_sign: | N/A | secondary | +| `ViewMode` | **int* | :heavy_minus_sign: | N/A | 65592 | +| `Directory` | [][operations.GetLibraryDirectory](../../models/operations/getlibrarydirectory.md) | :heavy_minus_sign: | N/A | [{"key":"search?type=1","prompt":"Search Movies","search":true,"secondary":true,"title":"Search..."}] | +| `Type` | [][operations.GetLibraryType](../../models/operations/getlibrarytype.md) | :heavy_minus_sign: | N/A | [{"Field":[{"key":"title","title":"Title","type":"string"},{"key":"studio","title":"Studio","type":"string"},{"key":"userRating","subType":"rating","title":"Rating","type":"integer"},{"key":"contentRating","title":"Content Rating","type":"tag"},{"key":"year","subType":"year","title":"Year","type":"integer"},{"key":"decade","subType":"decade","title":"Decade","type":"integer"},{"key":"originallyAvailableAt","title":"Release Date","type":"date"},{"key":"duration","subType":"duration","title":"Duration","type":"integer"},{"key":"unmatched","title":"Unmatched","type":"boolean"},{"key":"duplicate","title":"Duplicate","type":"boolean"},{"key":"genre","title":"Genre","type":"tag"},{"key":"collection","title":"Collection","type":"tag"},{"key":"director","title":"Director","type":"tag"},{"key":"writer","title":"Writer","type":"tag"},{"key":"producer","title":"Producer","type":"tag"},{"key":"actor","title":"Actor","type":"tag"},{"key":"country","title":"Country","type":"tag"},{"key":"addedAt","title":"Date Added","type":"date"},{"key":"viewCount","title":"Plays","type":"integer"},{"key":"lastViewedAt","title":"Last Played","type":"date"},{"key":"unwatched","title":"Unplayed","type":"boolean"},{"key":"resolution","title":"Resolution","type":"resolution"},{"key":"hdr","subType":"hdr","title":"HDR","type":"boolean"},{"key":"mediaSize","subType":"fileSize","title":"File Size","type":"integer"},{"key":"mediaBitrate","subType":"bitrate","title":"Bitrate","type":"integer"},{"key":"subtitleLanguage","title":"Subtitle Language","type":"subtitleLanguage"},{"key":"audioLanguage","title":"Audio Language","type":"audioLanguage"},{"key":"inProgress","title":"In Progress","type":"boolean"},{"key":"trash","title":"Trash","type":"boolean"},{"key":"editionTitle","title":"Edition","type":"string"},{"key":"label","title":"Label","type":"tag"}],"Filter":[{"filter":"genre","filterType":"string","key":"/library/sections/1/genre","title":"Genre","type":"filter"},{"filter":"year","filterType":"integer","key":"/library/sections/1/year","title":"Year","type":"filter"},{"filter":"decade","filterType":"integer","key":"/library/sections/1/decade","title":"Decade","type":"filter"},{"filter":"contentRating","filterType":"string","key":"/library/sections/1/contentRating","title":"Content Rating","type":"filter"},{"filter":"collection","filterType":"string","key":"/library/sections/1/collection","title":"Collection","type":"filter"},{"filter":"director","filterType":"string","key":"/library/sections/1/director","title":"Director","type":"filter"},{"filter":"actor","filterType":"string","key":"/library/sections/1/actor","title":"Actor","type":"filter"},{"filter":"writer","filterType":"string","key":"/library/sections/1/writer","title":"Writer","type":"filter"},{"filter":"producer","filterType":"string","key":"/library/sections/1/producer","title":"Producer","type":"filter"},{"filter":"country","filterType":"string","key":"/library/sections/1/country","title":"Country","type":"filter"},{"filter":"studio","filterType":"string","key":"/library/sections/1/studio","title":"Studio","type":"filter"},{"filter":"resolution","filterType":"string","key":"/library/sections/1/resolution","title":"Resolution","type":"filter"},{"filter":"hdr","filterType":"boolean","key":"/library/sections/1/hdr","title":"HDR","type":"filter"},{"filter":"unwatched","filterType":"boolean","key":"/library/sections/1/unwatched","title":"Unplayed","type":"filter"},{"filter":"inProgress","filterType":"boolean","key":"/library/sections/1/inProgress","title":"In Progress","type":"filter"},{"filter":"unmatched","filterType":"boolean","key":"/library/sections/1/unmatched","title":"Unmatched","type":"filter"},{"filter":"audioLanguage","filterType":"string","key":"/library/sections/1/audioLanguage","title":"Audio Language","type":"filter"},{"filter":"subtitleLanguage","filterType":"string","key":"/library/sections/1/subtitleLanguage","title":"Subtitle Language","type":"filter"},{"filter":"editionTitle","filterType":"string","key":"/library/sections/1/editionTitle","title":"Edition","type":"filter"},{"filter":"label","filterType":"string","key":"/library/sections/1/label","title":"Labels","type":"filter"}],"Sort":[{"default":"asc","defaultDirection":"asc","descKey":"titleSort:desc","firstCharacterKey":"/library/sections/1/firstCharacter","key":"titleSort","title":"Title"},{"defaultDirection":"desc","descKey":"originallyAvailableAt:desc","key":"originallyAvailableAt","title":"Release Date"},{"defaultDirection":"desc","descKey":"rating:desc","key":"rating","title":"Critic Rating"},{"defaultDirection":"desc","descKey":"audienceRating:desc","key":"audienceRating","title":"Audience Rating"},{"defaultDirection":"desc","descKey":"duration:desc","key":"duration","title":"Duration"},{"defaultDirection":"desc","descKey":"addedAt:desc","key":"addedAt","title":"Date Added"},{"defaultDirection":"desc","descKey":"lastViewedAt:desc","key":"lastViewedAt","title":"Date Viewed"},{"defaultDirection":"asc","descKey":"mediaHeight:desc","key":"mediaHeight","title":"Resolution"},{"defaultDirection":"desc","descKey":"random:desc","key":"random","title":"Randomly"}],"active":false,"key":"/library/sections/1/all?type=1","title":"Movies","type":"movie"}] | +| `FieldType` | [][operations.FieldType](../../models/operations/fieldtype.md) | :heavy_minus_sign: | N/A | [{"Operator":[{"key":"=","title":"is"}],"type":"resolution"}] | \ No newline at end of file diff --git a/docs/models/operations/getlibrarytype.md b/docs/models/operations/getlibrarytype.md new file mode 100644 index 0000000..9912250 --- /dev/null +++ b/docs/models/operations/getlibrarytype.md @@ -0,0 +1,14 @@ +# GetLibraryType + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | +| `Type` | **string* | :heavy_minus_sign: | N/A | movie | +| `Title` | **string* | :heavy_minus_sign: | N/A | Movies | +| `Active` | **bool* | :heavy_minus_sign: | N/A | false | +| `Filter` | [][operations.Filter](../../models/operations/filter.md) | :heavy_minus_sign: | N/A | [{"filter":"label","filterType":"string","key":"/library/sections/1/label","title":"Labels","type":"filter"}] | +| `Sort` | [][operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | N/A | [{"default":"asc","defaultDirection":"desc","descKey":"random:desc","firstCharacterKey":"/library/sections/1/firstCharacter","key":"random","title":"Randomly"}] | +| `Field` | [][operations.Field](../../models/operations/field.md) | :heavy_minus_sign: | N/A | [{"key":"label","subType":"bitrate","title":"Label","type":"tag"}] | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesmediacontainer.md b/docs/models/operations/getserverpreferencesmediacontainer.md new file mode 100644 index 0000000..7ad9d07 --- /dev/null +++ b/docs/models/operations/getserverpreferencesmediacontainer.md @@ -0,0 +1,9 @@ +# GetServerPreferencesMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Size` | **int* | :heavy_minus_sign: | N/A | 161 | +| `Setting` | [][operations.Setting](../../models/operations/setting.md) | :heavy_minus_sign: | N/A | [{"advanced":false,"default":"","group":"general","hidden":false,"id":"FriendlyName","label":"Friendly name","summary":"This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead.","type":"text","value":"Hera"},{"advanced":false,"default":3600,"enumValues":"900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily","group":"library","hidden":false,"id":"ScheduledLibraryUpdateInterval","label":"Library scan interval","summary":"","type":"int","value":3600}] | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesresponse.md b/docs/models/operations/getserverpreferencesresponse.md index d035686..749fc7d 100644 --- a/docs/models/operations/getserverpreferencesresponse.md +++ b/docs/models/operations/getserverpreferencesresponse.md @@ -3,8 +3,9 @@ ## 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 | \ No newline at end of file +| 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.GetServerPreferencesResponseBody](../../models/operations/getserverpreferencesresponsebody.md) | :heavy_minus_sign: | Server Preferences | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesresponsebody.md b/docs/models/operations/getserverpreferencesresponsebody.md new file mode 100644 index 0000000..4bf2ad9 --- /dev/null +++ b/docs/models/operations/getserverpreferencesresponsebody.md @@ -0,0 +1,10 @@ +# GetServerPreferencesResponseBody + +Server Preferences + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetServerPreferencesMediaContainer](../../models/operations/getserverpreferencesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/one.md b/docs/models/operations/one.md new file mode 100644 index 0000000..12213b0 --- /dev/null +++ b/docs/models/operations/one.md @@ -0,0 +1,16 @@ +# One + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | **string* | :heavy_minus_sign: | N/A | FriendlyName | +| `Label` | **string* | :heavy_minus_sign: | N/A | Friendly name | +| `Summary` | **string* | :heavy_minus_sign: | N/A | This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead. | +| `Type` | **string* | :heavy_minus_sign: | N/A | text | +| `Default` | **string* | :heavy_minus_sign: | N/A | | +| `Value` | **string* | :heavy_minus_sign: | N/A | Hera | +| `Hidden` | **bool* | :heavy_minus_sign: | N/A | false | +| `Advanced` | **bool* | :heavy_minus_sign: | N/A | false | +| `Group` | **string* | :heavy_minus_sign: | N/A | general | \ No newline at end of file diff --git a/docs/models/operations/operator.md b/docs/models/operations/operator.md new file mode 100644 index 0000000..aa64ff2 --- /dev/null +++ b/docs/models/operations/operator.md @@ -0,0 +1,9 @@ +# Operator + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | = | +| `Title` | **string* | :heavy_minus_sign: | N/A | is | \ No newline at end of file diff --git a/docs/models/operations/setting.md b/docs/models/operations/setting.md new file mode 100644 index 0000000..b980567 --- /dev/null +++ b/docs/models/operations/setting.md @@ -0,0 +1,17 @@ +# Setting + + +## Supported Types + +### One + +```go +setting := operations.CreateSettingOne(operations.One{/* values here */}) +``` + +### Two + +```go +setting := operations.CreateSettingTwo(operations.Two{/* values here */}) +``` + diff --git a/docs/models/operations/sort.md b/docs/models/operations/sort.md new file mode 100644 index 0000000..c557111 --- /dev/null +++ b/docs/models/operations/sort.md @@ -0,0 +1,13 @@ +# Sort + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `Default` | **string* | :heavy_minus_sign: | N/A | asc | +| `DefaultDirection` | **string* | :heavy_minus_sign: | N/A | desc | +| `DescKey` | **string* | :heavy_minus_sign: | N/A | random:desc | +| `FirstCharacterKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/firstCharacter | +| `Key` | **string* | :heavy_minus_sign: | N/A | random | +| `Title` | **string* | :heavy_minus_sign: | N/A | Randomly | \ No newline at end of file diff --git a/docs/models/operations/two.md b/docs/models/operations/two.md new file mode 100644 index 0000000..2c6f26c --- /dev/null +++ b/docs/models/operations/two.md @@ -0,0 +1,17 @@ +# Two + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | N/A | ScheduledLibraryUpdateInterval | +| `Label` | **string* | :heavy_minus_sign: | N/A | Library scan interval | +| `Summary` | **string* | :heavy_minus_sign: | N/A | | +| `Type` | **string* | :heavy_minus_sign: | N/A | int | +| `Default` | **int* | :heavy_minus_sign: | N/A | 3600 | +| `Value` | **int* | :heavy_minus_sign: | N/A | 3600 | +| `Hidden` | **bool* | :heavy_minus_sign: | N/A | false | +| `Advanced` | **bool* | :heavy_minus_sign: | N/A | false | +| `Group` | **string* | :heavy_minus_sign: | N/A | library | +| `EnumValues` | **string* | :heavy_minus_sign: | N/A | 900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily | \ No newline at end of file diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 68df5bc..f239d11 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -79,7 +79,6 @@ import( "github.com/LukeHagar/plexgo" "context" "log" - "net/http" ) func main() { @@ -93,7 +92,7 @@ func main() { log.Fatal(err) } - if res.StatusCode == http.StatusOK { + if res.Object != nil { // handle response } } diff --git a/gen.yaml b/gen.yaml index bee8adf..5ba0aaf 100644 --- a/gen.yaml +++ b/gen.yaml @@ -8,7 +8,7 @@ generation: fixes: nameResolutionDec2023: false go: - version: 0.0.5 + version: 0.1.0 clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true imports: diff --git a/models/operations/getlibrary.go b/models/operations/getlibrary.go index a33c21c..a2659e8 100644 --- a/models/operations/getlibrary.go +++ b/models/operations/getlibrary.go @@ -73,11 +73,25 @@ func (o *GetLibraryRequest) GetIncludeDetails() *IncludeDetails { } type GetLibraryDirectory struct { + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` Secondary *bool `json:"secondary,omitempty"` Prompt *string `json:"prompt,omitempty"` Search *bool `json:"search,omitempty"` - Key *string `json:"key,omitempty"` - Title *string `json:"title,omitempty"` +} + +func (o *GetLibraryDirectory) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetLibraryDirectory) GetTitle() *string { + if o == nil { + return nil + } + return o.Title } func (o *GetLibraryDirectory) GetSecondary() *bool { @@ -101,20 +115,232 @@ func (o *GetLibraryDirectory) GetSearch() *bool { return o.Search } -func (o *GetLibraryDirectory) GetKey() *string { +type Filter struct { + Filter *string `json:"filter,omitempty"` + FilterType *string `json:"filterType,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *Filter) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +func (o *Filter) GetFilterType() *string { + if o == nil { + return nil + } + return o.FilterType +} + +func (o *Filter) GetKey() *string { if o == nil { return nil } return o.Key } -func (o *GetLibraryDirectory) GetTitle() *string { +func (o *Filter) GetTitle() *string { if o == nil { return nil } return o.Title } +func (o *Filter) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +type Sort struct { + Default *string `json:"default,omitempty"` + DefaultDirection *string `json:"defaultDirection,omitempty"` + DescKey *string `json:"descKey,omitempty"` + FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (o *Sort) GetDefault() *string { + if o == nil { + return nil + } + return o.Default +} + +func (o *Sort) GetDefaultDirection() *string { + if o == nil { + return nil + } + return o.DefaultDirection +} + +func (o *Sort) GetDescKey() *string { + if o == nil { + return nil + } + return o.DescKey +} + +func (o *Sort) GetFirstCharacterKey() *string { + if o == nil { + return nil + } + return o.FirstCharacterKey +} + +func (o *Sort) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Sort) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +type Field struct { + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + SubType *string `json:"subType,omitempty"` +} + +func (o *Field) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Field) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Field) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *Field) GetSubType() *string { + if o == nil { + return nil + } + return o.SubType +} + +type GetLibraryType struct { + Key *string `json:"key,omitempty"` + Type *string `json:"type,omitempty"` + Title *string `json:"title,omitempty"` + Active *bool `json:"active,omitempty"` + Filter []Filter `json:"Filter,omitempty"` + Sort []Sort `json:"Sort,omitempty"` + Field []Field `json:"Field,omitempty"` +} + +func (o *GetLibraryType) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetLibraryType) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *GetLibraryType) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *GetLibraryType) GetActive() *bool { + if o == nil { + return nil + } + return o.Active +} + +func (o *GetLibraryType) GetFilter() []Filter { + if o == nil { + return nil + } + return o.Filter +} + +func (o *GetLibraryType) GetSort() []Sort { + if o == nil { + return nil + } + return o.Sort +} + +func (o *GetLibraryType) GetField() []Field { + if o == nil { + return nil + } + return o.Field +} + +type Operator struct { + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (o *Operator) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Operator) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +type FieldType struct { + Type *string `json:"type,omitempty"` + Operator []Operator `json:"Operator,omitempty"` +} + +func (o *FieldType) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *FieldType) GetOperator() []Operator { + if o == nil { + return nil + } + return o.Operator +} + type GetLibraryMediaContainer struct { Size *int `json:"size,omitempty"` AllowSync *bool `json:"allowSync,omitempty"` @@ -129,6 +355,8 @@ type GetLibraryMediaContainer struct { ViewGroup *string `json:"viewGroup,omitempty"` ViewMode *int `json:"viewMode,omitempty"` Directory []GetLibraryDirectory `json:"Directory,omitempty"` + Type []GetLibraryType `json:"Type,omitempty"` + FieldType []FieldType `json:"FieldType,omitempty"` } func (o *GetLibraryMediaContainer) GetSize() *int { @@ -222,6 +450,20 @@ func (o *GetLibraryMediaContainer) GetDirectory() []GetLibraryDirectory { return o.Directory } +func (o *GetLibraryMediaContainer) GetType() []GetLibraryType { + if o == nil { + return nil + } + return o.Type +} + +func (o *GetLibraryMediaContainer) GetFieldType() []FieldType { + if o == nil { + return nil + } + return o.FieldType +} + // GetLibraryResponseBody - The details of the library type GetLibraryResponseBody struct { MediaContainer *GetLibraryMediaContainer `json:"MediaContainer,omitempty"` diff --git a/models/operations/getserverpreferences.go b/models/operations/getserverpreferences.go index 1d0ded7..8f62a72 100644 --- a/models/operations/getserverpreferences.go +++ b/models/operations/getserverpreferences.go @@ -3,9 +3,263 @@ package operations import ( + "errors" + "github.com/LukeHagar/plexgo/internal/utils" "net/http" ) +type Two struct { + ID *string `json:"id,omitempty"` + Label *string `json:"label,omitempty"` + Summary *string `json:"summary,omitempty"` + Type *string `json:"type,omitempty"` + Default *int `json:"default,omitempty"` + Value *int `json:"value,omitempty"` + Hidden *bool `json:"hidden,omitempty"` + Advanced *bool `json:"advanced,omitempty"` + Group *string `json:"group,omitempty"` + EnumValues *string `json:"enumValues,omitempty"` +} + +func (o *Two) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Two) GetLabel() *string { + if o == nil { + return nil + } + return o.Label +} + +func (o *Two) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *Two) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *Two) GetDefault() *int { + if o == nil { + return nil + } + return o.Default +} + +func (o *Two) GetValue() *int { + if o == nil { + return nil + } + return o.Value +} + +func (o *Two) GetHidden() *bool { + if o == nil { + return nil + } + return o.Hidden +} + +func (o *Two) GetAdvanced() *bool { + if o == nil { + return nil + } + return o.Advanced +} + +func (o *Two) GetGroup() *string { + if o == nil { + return nil + } + return o.Group +} + +func (o *Two) GetEnumValues() *string { + if o == nil { + return nil + } + return o.EnumValues +} + +type One struct { + ID *string `json:"id,omitempty"` + Label *string `json:"label,omitempty"` + Summary *string `json:"summary,omitempty"` + Type *string `json:"type,omitempty"` + Default *string `json:"default,omitempty"` + Value *string `json:"value,omitempty"` + Hidden *bool `json:"hidden,omitempty"` + Advanced *bool `json:"advanced,omitempty"` + Group *string `json:"group,omitempty"` +} + +func (o *One) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *One) GetLabel() *string { + if o == nil { + return nil + } + return o.Label +} + +func (o *One) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *One) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *One) GetDefault() *string { + if o == nil { + return nil + } + return o.Default +} + +func (o *One) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *One) GetHidden() *bool { + if o == nil { + return nil + } + return o.Hidden +} + +func (o *One) GetAdvanced() *bool { + if o == nil { + return nil + } + return o.Advanced +} + +func (o *One) GetGroup() *string { + if o == nil { + return nil + } + return o.Group +} + +type SettingType string + +const ( + SettingTypeOne SettingType = "1" + SettingTypeTwo SettingType = "2" +) + +type Setting struct { + One *One + Two *Two + + Type SettingType +} + +func CreateSettingOne(one One) Setting { + typ := SettingTypeOne + + return Setting{ + One: &one, + Type: typ, + } +} + +func CreateSettingTwo(two Two) Setting { + typ := SettingTypeTwo + + return Setting{ + Two: &two, + Type: typ, + } +} + +func (u *Setting) UnmarshalJSON(data []byte) error { + + one := One{} + if err := utils.UnmarshalJSON(data, &one, "", true, true); err == nil { + u.One = &one + u.Type = SettingTypeOne + return nil + } + + two := Two{} + if err := utils.UnmarshalJSON(data, &two, "", true, true); err == nil { + u.Two = &two + u.Type = SettingTypeTwo + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u Setting) MarshalJSON() ([]byte, error) { + if u.One != nil { + return utils.MarshalJSON(u.One, "", true) + } + + if u.Two != nil { + return utils.MarshalJSON(u.Two, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} + +type GetServerPreferencesMediaContainer struct { + Size *int `json:"size,omitempty"` + Setting []Setting `json:"Setting,omitempty"` +} + +func (o *GetServerPreferencesMediaContainer) GetSize() *int { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetServerPreferencesMediaContainer) GetSetting() []Setting { + if o == nil { + return nil + } + return o.Setting +} + +// GetServerPreferencesResponseBody - Server Preferences +type GetServerPreferencesResponseBody struct { + MediaContainer *GetServerPreferencesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetServerPreferencesResponseBody) GetMediaContainer() *GetServerPreferencesMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + type GetServerPreferencesResponse struct { // HTTP response content type for this operation ContentType string @@ -13,6 +267,8 @@ type GetServerPreferencesResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response + // Server Preferences + Object *GetServerPreferencesResponseBody } func (o *GetServerPreferencesResponse) GetContentType() string { @@ -35,3 +291,10 @@ func (o *GetServerPreferencesResponse) GetRawResponse() *http.Response { } return o.RawResponse } + +func (o *GetServerPreferencesResponse) GetObject() *GetServerPreferencesResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/plexapi.go b/plexapi.go index 5958d41..a70286e 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.0.5", - GenVersion: "2.237.2", - UserAgent: "speakeasy-sdk/go 0.0.5 2.237.2 0.0.3 github.com/LukeHagar/plexgo", + SDKVersion: "0.1.0", + GenVersion: "2.237.3", + UserAgent: "speakeasy-sdk/go 0.1.0 2.237.3 0.0.3 github.com/LukeHagar/plexgo", ServerDefaults: []map[string]string{ { "protocol": "http", diff --git a/server.go b/server.go index 986051a..9753fc2 100644 --- a/server.go +++ b/server.go @@ -138,6 +138,17 @@ func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServe httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetServerPreferencesResponseBody + 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: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: