mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 12:37:46 +00:00
301 lines
5.2 KiB
Go
301 lines
5.2 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
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
|
|
// HTTP response status code for this operation
|
|
StatusCode int
|
|
// Raw HTTP response; suitable for custom response parsing
|
|
RawResponse *http.Response
|
|
// Server Preferences
|
|
Object *GetServerPreferencesResponseBody
|
|
}
|
|
|
|
func (o *GetServerPreferencesResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *GetServerPreferencesResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *GetServerPreferencesResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *GetServerPreferencesResponse) GetObject() *GetServerPreferencesResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Object
|
|
}
|