Compare commits

...

6 Commits

Author SHA1 Message Date
speakeasybot
70d2e2a152 ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.148.0 2024-01-20 03:10:30 +00:00
speakeasybot
89e9047e5b ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.147.0 2024-01-19 17:28:27 +00:00
speakeasybot
79e46e9d00 ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.147.0 2024-01-18 23:37:24 +00:00
speakeasybot
46d64acf0d ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.142.1 2024-01-17 00:48:40 +00:00
speakeasybot
9132d30c11 ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1 2024-01-05 19:51:02 +00:00
Luke Hagar
bba1a7ab9e Update README.md 2024-01-05 13:43:58 -06:00
35 changed files with 1301 additions and 52 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: dfa99515-01c0-42eb-9be5-ee212fd03eb3
management:
docChecksum: 550154cf1b4d0c237436fb18c418b5db
docChecksum: 1e8e82037a237e1d1467721fbd2c7ab0
docVersion: 0.0.3
speakeasyVersion: internal
generationVersion: 2.228.1
releaseVersion: 0.0.1
configChecksum: 17cc95530e519354b089a256cb0ca7f6
generationVersion: 2.237.3
releaseVersion: 0.1.0
configChecksum: 73d3c85671a6bde12c0c56fe7e1dc772
repoURL: https://github.com/LukeHagar/plexgo.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexgo
@@ -14,11 +14,12 @@ management:
features:
go:
constsAndDefaults: 0.1.2
core: 3.3.0
core: 3.3.1
flattening: 2.81.1
globalSecurity: 2.82.3
globalSecurity: 2.82.4
globalServerURLs: 2.82.1
nameOverrides: 2.81.1
unions: 2.85.2
generatedFiles:
- server.go
- media.go
@@ -36,7 +37,6 @@ generatedFiles:
- plexapi.go
- go.mod
- go.sum
- tests/helpers.go
- models/sdkerrors/sdkerror.go
- types/bigint.go
- types/date.go
@@ -174,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
@@ -258,9 +263,22 @@ generatedFiles:
- docs/models/operations/getrecentlyaddedmediacontainer.md
- docs/models/operations/getrecentlyaddedresponsebody.md
- docs/models/operations/getrecentlyaddedresponse.md
- docs/models/operations/location.md
- docs/models/operations/getlibrariesdirectory.md
- docs/models/operations/getlibrariesmediacontainer.md
- docs/models/operations/getlibrariesresponsebody.md
- docs/models/operations/getlibrariesresponse.md
- 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
- docs/models/operations/deletelibraryrequest.md
- docs/models/operations/deletelibraryresponse.md

View File

@@ -7,15 +7,6 @@
</a>
</div>
## 🏗 **Welcome to your new SDK!** 🏗
It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)
- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)
- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)
- [ ] ✨ When ready to productionize, delete this section from the README
<!-- Start SDK Installation [installation] -->
## SDK Installation
@@ -218,8 +209,7 @@ You can override the default server globally using the `WithServerIndex` option
| # | Server | Variables |
| - | ------ | --------- |
| 0 | `http://10.10.10.47:32400` | None |
| 1 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
#### Example
@@ -235,7 +225,7 @@ import (
func main() {
s := plexgo.New(
plexgo.WithServerIndex(1),
plexgo.WithServerIndex(0),
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
@@ -274,7 +264,7 @@ import (
func main() {
s := plexgo.New(
plexgo.WithServerURL("http://10.10.10.47:32400"),
plexgo.WithServerURL("{protocol}://{ip}:{port}"),
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)

View File

@@ -8,4 +8,54 @@ Based on:
### Generated
- [go v0.0.1] .
### Releases
- [Go v0.0.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.1 - .
- [Go v0.0.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.1 - .
## 2024-01-05 19:50:49
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.133.1 (2.228.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.0.2] .
### Releases
- [Go v0.0.2] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.2 - .
## 2024-01-17 00:48:29
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.142.1 (2.234.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.0.3] .
### Releases
- [Go v0.0.3] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.3 - .
## 2024-01-18 23:37:12
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.147.0 (2.237.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.0.4] .
### Releases
- [Go v0.0.4] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.4 - .
## 2024-01-19 17:28:15
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.147.0 (2.237.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.0.5] .
### Releases
- [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 - .

View File

@@ -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 |

View File

@@ -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"}] |

View File

@@ -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 |

View File

@@ -0,0 +1,28 @@
# GetLibrariesDirectory
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | true |
| `Art` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
| `Composite` | **string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
| `Filters` | **bool* | :heavy_minus_sign: | N/A | true |
| `Refreshing` | **bool* | :heavy_minus_sign: | N/A | false |
| `Thumb` | **string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
| `Key` | **string* | :heavy_minus_sign: | N/A | 1 |
| `Type` | **string* | :heavy_minus_sign: | N/A | movie |
| `Title` | **string* | :heavy_minus_sign: | N/A | Movies |
| `Agent` | **string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie |
| `Scanner` | **string* | :heavy_minus_sign: | N/A | Plex Movie |
| `Language` | **string* | :heavy_minus_sign: | N/A | en-US |
| `UUID` | **string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `UpdatedAt` | **int* | :heavy_minus_sign: | N/A | 1705615634 |
| `CreatedAt` | **int* | :heavy_minus_sign: | N/A | 1654131312 |
| `ScannedAt` | **int* | :heavy_minus_sign: | N/A | 1705615584 |
| `Content` | **bool* | :heavy_minus_sign: | N/A | true |
| `Directory` | **bool* | :heavy_minus_sign: | N/A | true |
| `ContentChangedAt` | **int* | :heavy_minus_sign: | N/A | 3192854 |
| `Hidden` | **int* | :heavy_minus_sign: | N/A | 0 |
| `Location` | [][operations.Location](../../models/operations/location.md) | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |

View File

@@ -0,0 +1,11 @@
# GetLibrariesMediaContainer
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Size` | **int* | :heavy_minus_sign: | N/A | 5 |
| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | false |
| `Title1` | **string* | :heavy_minus_sign: | N/A | Plex Library |
| `Directory` | [][operations.GetLibrariesDirectory](../../models/operations/getlibrariesdirectory.md) | :heavy_minus_sign: | N/A | [{"Location":[{"id":1,"path":"/movies"}],"agent":"tv.plex.agents.movie","allowSync":true,"art":"/:/resources/movie-fanart.jpg","composite":"/library/sections/1/composite/1705615584","content":true,"contentChangedAt":3192854,"createdAt":1654131312,"directory":true,"filters":true,"hidden":0,"key":"1","language":"en-US","refreshing":false,"scannedAt":1705615584,"scanner":"Plex Movie","thumb":"/:/resources/movie.png","title":"Movies","type":"movie","updatedAt":1705615634,"uuid":"322a231a-b7f7-49f5-920f-14c61199cd30"}] |

View File

@@ -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 |
| 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.GetLibrariesResponseBody](../../models/operations/getlibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server |

View File

@@ -0,0 +1,10 @@
# GetLibrariesResponseBody
The libraries available on the Server
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `MediaContainer` | [*operations.GetLibrariesMediaContainer](../../models/operations/getlibrariesmediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,12 @@
# GetLibraryDirectory
## Fields
| 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 |

File diff suppressed because one or more lines are too long

View File

@@ -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 |
| 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.GetLibraryResponseBody](../../models/operations/getlibraryresponsebody.md) | :heavy_minus_sign: | The details of the library |

View File

@@ -0,0 +1,10 @@
# GetLibraryResponseBody
The details of the library
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `MediaContainer` | [*operations.GetLibraryMediaContainer](../../models/operations/getlibrarymediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -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"}] |

View File

@@ -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}] |

View File

@@ -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 |
| 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 |

View File

@@ -0,0 +1,10 @@
# GetServerPreferencesResponseBody
Server Preferences
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `MediaContainer` | [*operations.GetServerPreferencesMediaContainer](../../models/operations/getserverpreferencesmediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,9 @@
# Location
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `ID` | **int* | :heavy_minus_sign: | N/A | 1 |
| `Path` | **string* | :heavy_minus_sign: | N/A | /movies |

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 */})
```

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -146,7 +146,6 @@ import(
"github.com/LukeHagar/plexgo"
"context"
"log"
"net/http"
)
func main() {
@@ -160,7 +159,7 @@ func main() {
log.Fatal(err)
}
if res.StatusCode == http.StatusOK {
if res.Object != nil {
// handle response
}
}
@@ -215,7 +214,6 @@ import(
"github.com/LukeHagar/plexgo/models/operations"
"context"
"log"
"net/http"
)
func main() {
@@ -234,7 +232,7 @@ func main() {
log.Fatal(err)
}
if res.StatusCode == http.StatusOK {
if res.Object != nil {
// handle response
}
}

View File

@@ -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
}
}

View File

@@ -8,7 +8,7 @@ generation:
fixes:
nameResolutionDec2023: false
go:
version: 0.0.1
version: 0.1.0
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
imports:

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/LukeHagar/plexgo
go 1.14
go 1.20
require (
github.com/cenkalti/backoff/v4 v4.2.0

View File

@@ -204,9 +204,9 @@ func parseSecuritySchemeValue(client *securityConfig, schemeTag *securityTag, se
panic("not supported")
}
case "openIdConnect":
client.headers[secTag.Name] = valToString(val)
client.headers[secTag.Name] = prefixBearer(valToString(val))
case "oauth2":
client.headers[secTag.Name] = valToString(val)
client.headers[secTag.Name] = prefixBearer(valToString(val))
case "http":
switch schemeTag.SubType {
case "bearer":

View File

@@ -215,6 +215,17 @@ func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesRes
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(contentType, `application/json`):
var out operations.GetLibrariesResponseBody
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:
@@ -311,6 +322,17 @@ func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDeta
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(contentType, `application/json`):
var out operations.GetLibraryResponseBody
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:

View File

@@ -6,6 +6,243 @@ import (
"net/http"
)
type Location struct {
ID *int `json:"id,omitempty"`
Path *string `json:"path,omitempty"`
}
func (o *Location) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *Location) GetPath() *string {
if o == nil {
return nil
}
return o.Path
}
type GetLibrariesDirectory struct {
AllowSync *bool `json:"allowSync,omitempty"`
Art *string `json:"art,omitempty"`
Composite *string `json:"composite,omitempty"`
Filters *bool `json:"filters,omitempty"`
Refreshing *bool `json:"refreshing,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Key *string `json:"key,omitempty"`
Type *string `json:"type,omitempty"`
Title *string `json:"title,omitempty"`
Agent *string `json:"agent,omitempty"`
Scanner *string `json:"scanner,omitempty"`
Language *string `json:"language,omitempty"`
UUID *string `json:"uuid,omitempty"`
UpdatedAt *int `json:"updatedAt,omitempty"`
CreatedAt *int `json:"createdAt,omitempty"`
ScannedAt *int `json:"scannedAt,omitempty"`
Content *bool `json:"content,omitempty"`
Directory *bool `json:"directory,omitempty"`
ContentChangedAt *int `json:"contentChangedAt,omitempty"`
Hidden *int `json:"hidden,omitempty"`
Location []Location `json:"Location,omitempty"`
}
func (o *GetLibrariesDirectory) GetAllowSync() *bool {
if o == nil {
return nil
}
return o.AllowSync
}
func (o *GetLibrariesDirectory) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetLibrariesDirectory) GetComposite() *string {
if o == nil {
return nil
}
return o.Composite
}
func (o *GetLibrariesDirectory) GetFilters() *bool {
if o == nil {
return nil
}
return o.Filters
}
func (o *GetLibrariesDirectory) GetRefreshing() *bool {
if o == nil {
return nil
}
return o.Refreshing
}
func (o *GetLibrariesDirectory) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetLibrariesDirectory) GetKey() *string {
if o == nil {
return nil
}
return o.Key
}
func (o *GetLibrariesDirectory) GetType() *string {
if o == nil {
return nil
}
return o.Type
}
func (o *GetLibrariesDirectory) GetTitle() *string {
if o == nil {
return nil
}
return o.Title
}
func (o *GetLibrariesDirectory) GetAgent() *string {
if o == nil {
return nil
}
return o.Agent
}
func (o *GetLibrariesDirectory) GetScanner() *string {
if o == nil {
return nil
}
return o.Scanner
}
func (o *GetLibrariesDirectory) GetLanguage() *string {
if o == nil {
return nil
}
return o.Language
}
func (o *GetLibrariesDirectory) GetUUID() *string {
if o == nil {
return nil
}
return o.UUID
}
func (o *GetLibrariesDirectory) GetUpdatedAt() *int {
if o == nil {
return nil
}
return o.UpdatedAt
}
func (o *GetLibrariesDirectory) GetCreatedAt() *int {
if o == nil {
return nil
}
return o.CreatedAt
}
func (o *GetLibrariesDirectory) GetScannedAt() *int {
if o == nil {
return nil
}
return o.ScannedAt
}
func (o *GetLibrariesDirectory) GetContent() *bool {
if o == nil {
return nil
}
return o.Content
}
func (o *GetLibrariesDirectory) GetDirectory() *bool {
if o == nil {
return nil
}
return o.Directory
}
func (o *GetLibrariesDirectory) GetContentChangedAt() *int {
if o == nil {
return nil
}
return o.ContentChangedAt
}
func (o *GetLibrariesDirectory) GetHidden() *int {
if o == nil {
return nil
}
return o.Hidden
}
func (o *GetLibrariesDirectory) GetLocation() []Location {
if o == nil {
return nil
}
return o.Location
}
type GetLibrariesMediaContainer struct {
Size *int `json:"size,omitempty"`
AllowSync *bool `json:"allowSync,omitempty"`
Title1 *string `json:"title1,omitempty"`
Directory []GetLibrariesDirectory `json:"Directory,omitempty"`
}
func (o *GetLibrariesMediaContainer) GetSize() *int {
if o == nil {
return nil
}
return o.Size
}
func (o *GetLibrariesMediaContainer) GetAllowSync() *bool {
if o == nil {
return nil
}
return o.AllowSync
}
func (o *GetLibrariesMediaContainer) GetTitle1() *string {
if o == nil {
return nil
}
return o.Title1
}
func (o *GetLibrariesMediaContainer) GetDirectory() []GetLibrariesDirectory {
if o == nil {
return nil
}
return o.Directory
}
// GetLibrariesResponseBody - The libraries available on the Server
type GetLibrariesResponseBody struct {
MediaContainer *GetLibrariesMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetLibrariesResponseBody) GetMediaContainer() *GetLibrariesMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetLibrariesResponse struct {
// HTTP response content type for this operation
ContentType string
@@ -13,6 +250,8 @@ type GetLibrariesResponse struct {
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
// The libraries available on the Server
Object *GetLibrariesResponseBody
}
func (o *GetLibrariesResponse) GetContentType() string {
@@ -35,3 +274,10 @@ func (o *GetLibrariesResponse) GetRawResponse() *http.Response {
}
return o.RawResponse
}
func (o *GetLibrariesResponse) GetObject() *GetLibrariesResponseBody {
if o == nil {
return nil
}
return o.Object
}

View File

@@ -72,6 +72,410 @@ func (o *GetLibraryRequest) GetIncludeDetails() *IncludeDetails {
return o.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"`
}
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 {
if o == nil {
return nil
}
return o.Secondary
}
func (o *GetLibraryDirectory) GetPrompt() *string {
if o == nil {
return nil
}
return o.Prompt
}
func (o *GetLibraryDirectory) GetSearch() *bool {
if o == nil {
return nil
}
return o.Search
}
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 *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"`
Art *string `json:"art,omitempty"`
Content *string `json:"content,omitempty"`
Identifier *string `json:"identifier,omitempty"`
LibrarySectionID *int `json:"librarySectionID,omitempty"`
MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"`
MediaTagVersion *int `json:"mediaTagVersion,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Title1 *string `json:"title1,omitempty"`
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 {
if o == nil {
return nil
}
return o.Size
}
func (o *GetLibraryMediaContainer) GetAllowSync() *bool {
if o == nil {
return nil
}
return o.AllowSync
}
func (o *GetLibraryMediaContainer) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetLibraryMediaContainer) GetContent() *string {
if o == nil {
return nil
}
return o.Content
}
func (o *GetLibraryMediaContainer) GetIdentifier() *string {
if o == nil {
return nil
}
return o.Identifier
}
func (o *GetLibraryMediaContainer) GetLibrarySectionID() *int {
if o == nil {
return nil
}
return o.LibrarySectionID
}
func (o *GetLibraryMediaContainer) GetMediaTagPrefix() *string {
if o == nil {
return nil
}
return o.MediaTagPrefix
}
func (o *GetLibraryMediaContainer) GetMediaTagVersion() *int {
if o == nil {
return nil
}
return o.MediaTagVersion
}
func (o *GetLibraryMediaContainer) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetLibraryMediaContainer) GetTitle1() *string {
if o == nil {
return nil
}
return o.Title1
}
func (o *GetLibraryMediaContainer) GetViewGroup() *string {
if o == nil {
return nil
}
return o.ViewGroup
}
func (o *GetLibraryMediaContainer) GetViewMode() *int {
if o == nil {
return nil
}
return o.ViewMode
}
func (o *GetLibraryMediaContainer) GetDirectory() []GetLibraryDirectory {
if o == nil {
return nil
}
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"`
}
func (o *GetLibraryResponseBody) GetMediaContainer() *GetLibraryMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetLibraryResponse struct {
// HTTP response content type for this operation
ContentType string
@@ -79,6 +483,8 @@ type GetLibraryResponse struct {
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
// The details of the library
Object *GetLibraryResponseBody
}
func (o *GetLibraryResponse) GetContentType() string {
@@ -101,3 +507,10 @@ func (o *GetLibraryResponse) GetRawResponse() *http.Response {
}
return o.RawResponse
}
func (o *GetLibraryResponse) GetObject() *GetLibraryResponseBody {
if o == nil {
return nil
}
return o.Object
}

View File

@@ -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
}

View File

@@ -14,8 +14,6 @@ import (
// ServerList contains the list of servers available to the SDK
var ServerList = []string{
// The full address of your Plex Server
"http://10.10.10.47:32400",
// The full address of your Plex Server
"{protocol}://{ip}:{port}",
}
@@ -253,11 +251,10 @@ func New(opts ...SDKOption) *PlexAPI {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "0.0.3",
SDKVersion: "0.0.1",
GenVersion: "2.228.1",
UserAgent: "speakeasy-sdk/go 0.0.1 2.228.1 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",
"ip": "10.10.10.47",

View File

@@ -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: