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

package operations

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

type ListPlaybackHistoryGlobals 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 ListPlaybackHistoryGlobals) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(l, "", false)
}

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

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

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

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

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

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

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

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

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

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

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

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

type ListPlaybackHistoryRequest 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 account id to restrict view history
	AccountID *int64 `queryParam:"style=form,explode=true,name=accountID"`
	// The time period to restrict history (typically of the form `viewedAt>=12456789`)
	ViewedAt *int64 `queryParam:"style=form,explode=true,name=viewedAt"`
	// The library section id to restrict view history
	LibrarySectionID *int64 `queryParam:"style=form,explode=true,name=librarySectionID"`
	// The metadata item to restrict view history (can provide the id for a show to see all of that show's view history).  Note this is translated to `metadata_items.id`, `parents.id`, or `grandparents.id` internally depending on the metadata type.
	MetadataItemID *int64 `queryParam:"style=form,explode=true,name=metadataItemID"`
	// The field on which to sort.  Multiple orderings can be specified separated by `,` and the direction specified following a `:` (`desc` or `asc`; `asc` is assumed if not provided).  Note `metadataItemID` may not be used here.
	Sort []string `queryParam:"style=form,explode=true,name=sort"`
}

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

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

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

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

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

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

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

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

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

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

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

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

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

func (l *ListPlaybackHistoryRequest) GetAccountID() *int64 {
	if l == nil {
		return nil
	}
	return l.AccountID
}

func (l *ListPlaybackHistoryRequest) GetViewedAt() *int64 {
	if l == nil {
		return nil
	}
	return l.ViewedAt
}

func (l *ListPlaybackHistoryRequest) GetLibrarySectionID() *int64 {
	if l == nil {
		return nil
	}
	return l.LibrarySectionID
}

func (l *ListPlaybackHistoryRequest) GetMetadataItemID() *int64 {
	if l == nil {
		return nil
	}
	return l.MetadataItemID
}

func (l *ListPlaybackHistoryRequest) GetSort() []string {
	if l == nil {
		return nil
	}
	return l.Sort
}

type ListPlaybackHistoryMetadata struct {
	// The account id of this playback
	AccountID *int64 `json:"accountID,omitempty"`
	// The device id which played the item
	DeviceID *int64 `json:"deviceID,omitempty"`
	// The key for this individual history item
	HistoryKey *string `json:"historyKey,omitempty"`
	// The metadata key for the item played
	Key *string `json:"key,omitempty"`
	// The library section id containing the item played
	LibrarySectionID *string `json:"librarySectionID,omitempty"`
	// The originally available at of the item played
	OriginallyAvailableAt *string `json:"originallyAvailableAt,omitempty"`
	// The rating key for the item played
	RatingKey *string `json:"ratingKey,omitempty"`
	// The thumb of the item played
	Thumb *string `json:"thumb,omitempty"`
	// The title of the item played
	Title *string `json:"title,omitempty"`
	// The metadata type of the item played
	Type *string `json:"type,omitempty"`
	// The time when the item was played
	ViewedAt *int64 `json:"viewedAt,omitempty"`
}

func (l *ListPlaybackHistoryMetadata) GetAccountID() *int64 {
	if l == nil {
		return nil
	}
	return l.AccountID
}

func (l *ListPlaybackHistoryMetadata) GetDeviceID() *int64 {
	if l == nil {
		return nil
	}
	return l.DeviceID
}

func (l *ListPlaybackHistoryMetadata) GetHistoryKey() *string {
	if l == nil {
		return nil
	}
	return l.HistoryKey
}

func (l *ListPlaybackHistoryMetadata) GetKey() *string {
	if l == nil {
		return nil
	}
	return l.Key
}

func (l *ListPlaybackHistoryMetadata) GetLibrarySectionID() *string {
	if l == nil {
		return nil
	}
	return l.LibrarySectionID
}

func (l *ListPlaybackHistoryMetadata) GetOriginallyAvailableAt() *string {
	if l == nil {
		return nil
	}
	return l.OriginallyAvailableAt
}

func (l *ListPlaybackHistoryMetadata) GetRatingKey() *string {
	if l == nil {
		return nil
	}
	return l.RatingKey
}

func (l *ListPlaybackHistoryMetadata) GetThumb() *string {
	if l == nil {
		return nil
	}
	return l.Thumb
}

func (l *ListPlaybackHistoryMetadata) GetTitle() *string {
	if l == nil {
		return nil
	}
	return l.Title
}

func (l *ListPlaybackHistoryMetadata) GetType() *string {
	if l == nil {
		return nil
	}
	return l.Type
}

func (l *ListPlaybackHistoryMetadata) GetViewedAt() *int64 {
	if l == nil {
		return nil
	}
	return l.ViewedAt
}

// ListPlaybackHistoryMediaContainer - `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 ListPlaybackHistoryMediaContainer 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"`
	Metadata  []ListPlaybackHistoryMetadata `json:"Metadata,omitempty"`
}

func (l *ListPlaybackHistoryMediaContainer) GetIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.Identifier
}

func (l *ListPlaybackHistoryMediaContainer) GetOffset() *int64 {
	if l == nil {
		return nil
	}
	return l.Offset
}

func (l *ListPlaybackHistoryMediaContainer) GetSize() *int64 {
	if l == nil {
		return nil
	}
	return l.Size
}

func (l *ListPlaybackHistoryMediaContainer) GetTotalSize() *int64 {
	if l == nil {
		return nil
	}
	return l.TotalSize
}

func (l *ListPlaybackHistoryMediaContainer) GetMetadata() []ListPlaybackHistoryMetadata {
	if l == nil {
		return nil
	}
	return l.Metadata
}

// ListPlaybackHistoryResponseBody - OK
type ListPlaybackHistoryResponseBody struct {
	MediaContainer *ListPlaybackHistoryMediaContainer `json:"MediaContainer,omitempty"`
}

func (l *ListPlaybackHistoryResponseBody) GetMediaContainer() *ListPlaybackHistoryMediaContainer {
	if l == nil {
		return nil
	}
	return l.MediaContainer
}

type ListPlaybackHistoryResponse 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  *ListPlaybackHistoryResponseBody
	Headers map[string][]string
}

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

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

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

func (l *ListPlaybackHistoryResponse) GetObject() *ListPlaybackHistoryResponseBody {
	if l == nil {
		return nil
	}
	return l.Object
}

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