// 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 GetPlaylistGeneratorsGlobals 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 (g GetPlaylistGeneratorsGlobals) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(g, "", false)
}

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

func (g *GetPlaylistGeneratorsGlobals) GetAccepts() *components.Accepts {
	if g == nil {
		return nil
	}
	return g.Accepts
}

func (g *GetPlaylistGeneratorsGlobals) GetClientIdentifier() *string {
	if g == nil {
		return nil
	}
	return g.ClientIdentifier
}

func (g *GetPlaylistGeneratorsGlobals) GetProduct() *string {
	if g == nil {
		return nil
	}
	return g.Product
}

func (g *GetPlaylistGeneratorsGlobals) GetVersion() *string {
	if g == nil {
		return nil
	}
	return g.Version
}

func (g *GetPlaylistGeneratorsGlobals) GetPlatform() *string {
	if g == nil {
		return nil
	}
	return g.Platform
}

func (g *GetPlaylistGeneratorsGlobals) GetPlatformVersion() *string {
	if g == nil {
		return nil
	}
	return g.PlatformVersion
}

func (g *GetPlaylistGeneratorsGlobals) GetDevice() *string {
	if g == nil {
		return nil
	}
	return g.Device
}

func (g *GetPlaylistGeneratorsGlobals) GetModel() *string {
	if g == nil {
		return nil
	}
	return g.Model
}

func (g *GetPlaylistGeneratorsGlobals) GetDeviceVendor() *string {
	if g == nil {
		return nil
	}
	return g.DeviceVendor
}

func (g *GetPlaylistGeneratorsGlobals) GetDeviceName() *string {
	if g == nil {
		return nil
	}
	return g.DeviceName
}

func (g *GetPlaylistGeneratorsGlobals) GetMarketplace() *string {
	if g == nil {
		return nil
	}
	return g.Marketplace
}

type GetPlaylistGeneratorsRequest 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"`
	// The ID of the playlist
	PlaylistID int64 `pathParam:"style=simple,explode=false,name=playlistId"`
}

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

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

func (g *GetPlaylistGeneratorsRequest) GetAccepts() *components.Accepts {
	if g == nil {
		return nil
	}
	return g.Accepts
}

func (g *GetPlaylistGeneratorsRequest) GetClientIdentifier() *string {
	if g == nil {
		return nil
	}
	return g.ClientIdentifier
}

func (g *GetPlaylistGeneratorsRequest) GetProduct() *string {
	if g == nil {
		return nil
	}
	return g.Product
}

func (g *GetPlaylistGeneratorsRequest) GetVersion() *string {
	if g == nil {
		return nil
	}
	return g.Version
}

func (g *GetPlaylistGeneratorsRequest) GetPlatform() *string {
	if g == nil {
		return nil
	}
	return g.Platform
}

func (g *GetPlaylistGeneratorsRequest) GetPlatformVersion() *string {
	if g == nil {
		return nil
	}
	return g.PlatformVersion
}

func (g *GetPlaylistGeneratorsRequest) GetDevice() *string {
	if g == nil {
		return nil
	}
	return g.Device
}

func (g *GetPlaylistGeneratorsRequest) GetModel() *string {
	if g == nil {
		return nil
	}
	return g.Model
}

func (g *GetPlaylistGeneratorsRequest) GetDeviceVendor() *string {
	if g == nil {
		return nil
	}
	return g.DeviceVendor
}

func (g *GetPlaylistGeneratorsRequest) GetDeviceName() *string {
	if g == nil {
		return nil
	}
	return g.DeviceName
}

func (g *GetPlaylistGeneratorsRequest) GetMarketplace() *string {
	if g == nil {
		return nil
	}
	return g.Marketplace
}

func (g *GetPlaylistGeneratorsRequest) GetPlaylistID() int64 {
	if g == nil {
		return 0
	}
	return g.PlaylistID
}

// GetPlaylistGeneratorsType - The type of playlist generator.
//
//   - -1: A smart playlist generator
//   - 42: A optimized version generator
type GetPlaylistGeneratorsType int64

const (
	GetPlaylistGeneratorsTypeMinus1   GetPlaylistGeneratorsType = -1
	GetPlaylistGeneratorsTypeFortyTwo GetPlaylistGeneratorsType = 42
)

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

type PlayQueueGenerator struct {
	ChangedAt  *int64 `json:"changedAt,omitempty"`
	CreatedAt  *int64 `json:"createdAt,omitempty"`
	ID         *int64 `json:"id,omitempty"`
	PlaylistID *int64 `json:"playlistID,omitempty"`
	// The type of playlist generator.
	//
	//   - -1: A smart playlist generator
	//   - 42: A optimized version generator
	//
	Type      *GetPlaylistGeneratorsType `json:"type,omitempty"`
	UpdatedAt *int64                     `json:"updatedAt,omitempty"`
	// The URI indicating the search for this generator
	URI *string `json:"uri,omitempty"`
}

func (p *PlayQueueGenerator) GetChangedAt() *int64 {
	if p == nil {
		return nil
	}
	return p.ChangedAt
}

func (p *PlayQueueGenerator) GetCreatedAt() *int64 {
	if p == nil {
		return nil
	}
	return p.CreatedAt
}

func (p *PlayQueueGenerator) GetID() *int64 {
	if p == nil {
		return nil
	}
	return p.ID
}

func (p *PlayQueueGenerator) GetPlaylistID() *int64 {
	if p == nil {
		return nil
	}
	return p.PlaylistID
}

func (p *PlayQueueGenerator) GetType() *GetPlaylistGeneratorsType {
	if p == nil {
		return nil
	}
	return p.Type
}

func (p *PlayQueueGenerator) GetUpdatedAt() *int64 {
	if p == nil {
		return nil
	}
	return p.UpdatedAt
}

func (p *PlayQueueGenerator) GetURI() *string {
	if p == nil {
		return nil
	}
	return p.URI
}

// GetPlaylistGeneratorsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.
type GetPlaylistGeneratorsMediaContainer struct {
	Identifier *string `json:"identifier,omitempty"`
	// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
	//
	Offset *int64 `json:"offset,omitempty"`
	Size   *int64 `json:"size,omitempty"`
	// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
	//
	TotalSize          *int64               `json:"totalSize,omitempty"`
	PlayQueueGenerator []PlayQueueGenerator `json:"PlayQueueGenerator,omitempty"`
}

func (g *GetPlaylistGeneratorsMediaContainer) GetIdentifier() *string {
	if g == nil {
		return nil
	}
	return g.Identifier
}

func (g *GetPlaylistGeneratorsMediaContainer) GetOffset() *int64 {
	if g == nil {
		return nil
	}
	return g.Offset
}

func (g *GetPlaylistGeneratorsMediaContainer) GetSize() *int64 {
	if g == nil {
		return nil
	}
	return g.Size
}

func (g *GetPlaylistGeneratorsMediaContainer) GetTotalSize() *int64 {
	if g == nil {
		return nil
	}
	return g.TotalSize
}

func (g *GetPlaylistGeneratorsMediaContainer) GetPlayQueueGenerator() []PlayQueueGenerator {
	if g == nil {
		return nil
	}
	return g.PlayQueueGenerator
}

// GetPlaylistGeneratorsResponseBody - OK
type GetPlaylistGeneratorsResponseBody struct {
	MediaContainer *GetPlaylistGeneratorsMediaContainer `json:"MediaContainer,omitempty"`
}

func (g *GetPlaylistGeneratorsResponseBody) GetMediaContainer() *GetPlaylistGeneratorsMediaContainer {
	if g == nil {
		return nil
	}
	return g.MediaContainer
}

type GetPlaylistGeneratorsResponse 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
	Object *GetPlaylistGeneratorsResponseBody
}

func (g *GetPlaylistGeneratorsResponse) GetContentType() string {
	if g == nil {
		return ""
	}
	return g.ContentType
}

func (g *GetPlaylistGeneratorsResponse) GetStatusCode() int {
	if g == nil {
		return 0
	}
	return g.StatusCode
}

func (g *GetPlaylistGeneratorsResponse) GetRawResponse() *http.Response {
	if g == nil {
		return nil
	}
	return g.RawResponse
}

func (g *GetPlaylistGeneratorsResponse) GetObject() *GetPlaylistGeneratorsResponseBody {
	if g == nil {
		return nil
	}
	return g.Object
}
