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

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

func (m *ModifyPlaylistGeneratorGlobals) GetAccepts() *components.Accepts {
	if m == nil {
		return nil
	}
	return m.Accepts
}

func (m *ModifyPlaylistGeneratorGlobals) GetClientIdentifier() *string {
	if m == nil {
		return nil
	}
	return m.ClientIdentifier
}

func (m *ModifyPlaylistGeneratorGlobals) GetProduct() *string {
	if m == nil {
		return nil
	}
	return m.Product
}

func (m *ModifyPlaylistGeneratorGlobals) GetVersion() *string {
	if m == nil {
		return nil
	}
	return m.Version
}

func (m *ModifyPlaylistGeneratorGlobals) GetPlatform() *string {
	if m == nil {
		return nil
	}
	return m.Platform
}

func (m *ModifyPlaylistGeneratorGlobals) GetPlatformVersion() *string {
	if m == nil {
		return nil
	}
	return m.PlatformVersion
}

func (m *ModifyPlaylistGeneratorGlobals) GetDevice() *string {
	if m == nil {
		return nil
	}
	return m.Device
}

func (m *ModifyPlaylistGeneratorGlobals) GetModel() *string {
	if m == nil {
		return nil
	}
	return m.Model
}

func (m *ModifyPlaylistGeneratorGlobals) GetDeviceVendor() *string {
	if m == nil {
		return nil
	}
	return m.DeviceVendor
}

func (m *ModifyPlaylistGeneratorGlobals) GetDeviceName() *string {
	if m == nil {
		return nil
	}
	return m.DeviceName
}

func (m *ModifyPlaylistGeneratorGlobals) GetMarketplace() *string {
	if m == nil {
		return nil
	}
	return m.Marketplace
}

type ModifyPlaylistGeneratorQueryParamLocation struct {
	URI *string `queryParam:"name=uri"`
}

func (m *ModifyPlaylistGeneratorQueryParamLocation) GetURI() *string {
	if m == nil {
		return nil
	}
	return m.URI
}

type QueryParamScope string

const (
	QueryParamScopeAll   QueryParamScope = "all"
	QueryParamScopeCount QueryParamScope = "count"
)

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

type Policy struct {
	Value     *int64              `queryParam:"name=value"`
	Scope     *QueryParamScope    `queryParam:"name=scope"`
	Unwatched *components.BoolInt `default:"0" queryParam:"name=unwatched"`
}

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

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

func (p *Policy) GetValue() *int64 {
	if p == nil {
		return nil
	}
	return p.Value
}

func (p *Policy) GetScope() *QueryParamScope {
	if p == nil {
		return nil
	}
	return p.Scope
}

func (p *Policy) GetUnwatched() *components.BoolInt {
	if p == nil {
		return nil
	}
	return p.Unwatched
}

// Item - Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)).  It should be rendered as:
//
// Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0
type Item struct {
	Location    *ModifyPlaylistGeneratorQueryParamLocation `queryParam:"name=Location"`
	LocationID  *int64                                     `queryParam:"name=locationID"`
	Policy      *Policy                                    `queryParam:"name=Policy"`
	Target      *string                                    `queryParam:"name=target"`
	TargetTagID *int64                                     `queryParam:"name=targetTagID"`
	Title       *string                                    `queryParam:"name=title"`
	Type        *int64                                     `queryParam:"name=type"`
}

func (i *Item) GetLocation() *ModifyPlaylistGeneratorQueryParamLocation {
	if i == nil {
		return nil
	}
	return i.Location
}

func (i *Item) GetLocationID() *int64 {
	if i == nil {
		return nil
	}
	return i.LocationID
}

func (i *Item) GetPolicy() *Policy {
	if i == nil {
		return nil
	}
	return i.Policy
}

func (i *Item) GetTarget() *string {
	if i == nil {
		return nil
	}
	return i.Target
}

func (i *Item) GetTargetTagID() *int64 {
	if i == nil {
		return nil
	}
	return i.TargetTagID
}

func (i *Item) GetTitle() *string {
	if i == nil {
		return nil
	}
	return i.Title
}

func (i *Item) GetType() *int64 {
	if i == nil {
		return nil
	}
	return i.Type
}

type ModifyPlaylistGeneratorRequest 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"`
	// The generator item ID to modify.
	GeneratorID int64 `pathParam:"style=simple,explode=false,name=generatorId"`
	// Note: OpenAPI cannot properly render this query parameter example ([See GHI](https://github.com/OAI/OpenAPI-Specification/issues/1706)).  It should be rendered as:
	//
	// Item[type]=42&Item[title]=Jack-Jack Attack&Item[target]=&Item[targetTagID]=1&Item[locationID]=-1&Item[Location][uri]=library://82503060-0d68-4603-b594-8b071d54819e/item//library/metadata/146&Item[Policy][scope]=all&Item[Policy][value]=&Item[Policy][unwatched]=0
	//
	Item *Item `queryParam:"style=deepObject,explode=true,name=Item"`
}

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

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

func (m *ModifyPlaylistGeneratorRequest) GetAccepts() *components.Accepts {
	if m == nil {
		return nil
	}
	return m.Accepts
}

func (m *ModifyPlaylistGeneratorRequest) GetClientIdentifier() *string {
	if m == nil {
		return nil
	}
	return m.ClientIdentifier
}

func (m *ModifyPlaylistGeneratorRequest) GetProduct() *string {
	if m == nil {
		return nil
	}
	return m.Product
}

func (m *ModifyPlaylistGeneratorRequest) GetVersion() *string {
	if m == nil {
		return nil
	}
	return m.Version
}

func (m *ModifyPlaylistGeneratorRequest) GetPlatform() *string {
	if m == nil {
		return nil
	}
	return m.Platform
}

func (m *ModifyPlaylistGeneratorRequest) GetPlatformVersion() *string {
	if m == nil {
		return nil
	}
	return m.PlatformVersion
}

func (m *ModifyPlaylistGeneratorRequest) GetDevice() *string {
	if m == nil {
		return nil
	}
	return m.Device
}

func (m *ModifyPlaylistGeneratorRequest) GetModel() *string {
	if m == nil {
		return nil
	}
	return m.Model
}

func (m *ModifyPlaylistGeneratorRequest) GetDeviceVendor() *string {
	if m == nil {
		return nil
	}
	return m.DeviceVendor
}

func (m *ModifyPlaylistGeneratorRequest) GetDeviceName() *string {
	if m == nil {
		return nil
	}
	return m.DeviceName
}

func (m *ModifyPlaylistGeneratorRequest) GetMarketplace() *string {
	if m == nil {
		return nil
	}
	return m.Marketplace
}

func (m *ModifyPlaylistGeneratorRequest) GetPlaylistID() int64 {
	if m == nil {
		return 0
	}
	return m.PlaylistID
}

func (m *ModifyPlaylistGeneratorRequest) GetGeneratorID() int64 {
	if m == nil {
		return 0
	}
	return m.GeneratorID
}

func (m *ModifyPlaylistGeneratorRequest) GetItem() *Item {
	if m == nil {
		return nil
	}
	return m.Item
}

type ModifyPlaylistGeneratorResponse 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
}

func (m *ModifyPlaylistGeneratorResponse) GetContentType() string {
	if m == nil {
		return ""
	}
	return m.ContentType
}

func (m *ModifyPlaylistGeneratorResponse) GetStatusCode() int {
	if m == nil {
		return 0
	}
	return m.StatusCode
}

func (m *ModifyPlaylistGeneratorResponse) GetRawResponse() *http.Response {
	if m == nil {
		return nil
	}
	return m.RawResponse
}

func (m *ModifyPlaylistGeneratorResponse) GetMediaContainerWithPlaylistMetadata() *components.MediaContainerWithPlaylistMetadata {
	if m == nil {
		return nil
	}
	return m.MediaContainerWithPlaylistMetadata
}
