// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package operations

import (
	"encoding/json"
	"fmt"
	"github.com/LukeHagar/plexgo/internal/utils"
	"github.com/LukeHagar/plexgo/models/components"
	"net/http"
)

type ListPlaylistsGlobals struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
}

func (l ListPlaylistsGlobals) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(l, "", false)
}

func (l *ListPlaylistsGlobals) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (l *ListPlaylistsGlobals) GetAccepts() *components.Accepts {
	if l == nil {
		return nil
	}
	return l.Accepts
}

func (l *ListPlaylistsGlobals) GetClientIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.ClientIdentifier
}

func (l *ListPlaylistsGlobals) GetProduct() *string {
	if l == nil {
		return nil
	}
	return l.Product
}

func (l *ListPlaylistsGlobals) GetVersion() *string {
	if l == nil {
		return nil
	}
	return l.Version
}

func (l *ListPlaylistsGlobals) GetPlatform() *string {
	if l == nil {
		return nil
	}
	return l.Platform
}

func (l *ListPlaylistsGlobals) GetPlatformVersion() *string {
	if l == nil {
		return nil
	}
	return l.PlatformVersion
}

func (l *ListPlaylistsGlobals) GetDevice() *string {
	if l == nil {
		return nil
	}
	return l.Device
}

func (l *ListPlaylistsGlobals) GetModel() *string {
	if l == nil {
		return nil
	}
	return l.Model
}

func (l *ListPlaylistsGlobals) GetDeviceVendor() *string {
	if l == nil {
		return nil
	}
	return l.DeviceVendor
}

func (l *ListPlaylistsGlobals) GetDeviceName() *string {
	if l == nil {
		return nil
	}
	return l.DeviceName
}

func (l *ListPlaylistsGlobals) GetMarketplace() *string {
	if l == nil {
		return nil
	}
	return l.Marketplace
}

// PlaylistType - Limit to a type of playlist
type PlaylistType string

const (
	PlaylistTypeAudio PlaylistType = "audio"
	PlaylistTypeVideo PlaylistType = "video"
	PlaylistTypePhoto PlaylistType = "photo"
)

func (e PlaylistType) ToPointer() *PlaylistType {
	return &e
}
func (e *PlaylistType) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "audio":
		fallthrough
	case "video":
		fallthrough
	case "photo":
		*e = PlaylistType(v)
		return nil
	default:
		return fmt.Errorf("invalid value for PlaylistType: %v", v)
	}
}

type ListPlaylistsRequest struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
	// Limit to a type of playlist
	PlaylistType *PlaylistType `queryParam:"style=form,explode=true,name=playlistType"`
	// Whether this is a smart collection/playlist
	Smart *bool `queryParam:"style=form,explode=true,name=smart"`
}

func (l ListPlaylistsRequest) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(l, "", false)
}

func (l *ListPlaylistsRequest) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (l *ListPlaylistsRequest) GetAccepts() *components.Accepts {
	if l == nil {
		return nil
	}
	return l.Accepts
}

func (l *ListPlaylistsRequest) GetClientIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.ClientIdentifier
}

func (l *ListPlaylistsRequest) GetProduct() *string {
	if l == nil {
		return nil
	}
	return l.Product
}

func (l *ListPlaylistsRequest) GetVersion() *string {
	if l == nil {
		return nil
	}
	return l.Version
}

func (l *ListPlaylistsRequest) GetPlatform() *string {
	if l == nil {
		return nil
	}
	return l.Platform
}

func (l *ListPlaylistsRequest) GetPlatformVersion() *string {
	if l == nil {
		return nil
	}
	return l.PlatformVersion
}

func (l *ListPlaylistsRequest) GetDevice() *string {
	if l == nil {
		return nil
	}
	return l.Device
}

func (l *ListPlaylistsRequest) GetModel() *string {
	if l == nil {
		return nil
	}
	return l.Model
}

func (l *ListPlaylistsRequest) GetDeviceVendor() *string {
	if l == nil {
		return nil
	}
	return l.DeviceVendor
}

func (l *ListPlaylistsRequest) GetDeviceName() *string {
	if l == nil {
		return nil
	}
	return l.DeviceName
}

func (l *ListPlaylistsRequest) GetMarketplace() *string {
	if l == nil {
		return nil
	}
	return l.Marketplace
}

func (l *ListPlaylistsRequest) GetPlaylistType() *PlaylistType {
	if l == nil {
		return nil
	}
	return l.PlaylistType
}

func (l *ListPlaylistsRequest) GetSmart() *bool {
	if l == nil {
		return nil
	}
	return l.Smart
}

type ListPlaylistsResponse 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
	// OK
	MediaContainerWithPlaylistMetadata *components.MediaContainerWithPlaylistMetadata
	Headers                            map[string][]string
}

func (l *ListPlaylistsResponse) GetContentType() string {
	if l == nil {
		return ""
	}
	return l.ContentType
}

func (l *ListPlaylistsResponse) GetStatusCode() int {
	if l == nil {
		return 0
	}
	return l.StatusCode
}

func (l *ListPlaylistsResponse) GetRawResponse() *http.Response {
	if l == nil {
		return nil
	}
	return l.RawResponse
}

func (l *ListPlaylistsResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata {
	if l == nil {
		return nil
	}
	return l.MediaContainerWithPlaylistMetadata
}

func (l *ListPlaylistsResponse) GetHeaders() map[string][]string {
	if l == nil {
		return map[string][]string{}
	}
	return l.Headers
}
