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

package components

import (
	"github.com/LukeHagar/plexgo/internal/utils"
)

type FilterPivot struct {
	Title   *string `json:"title,omitempty"`
	Type    *string `json:"type,omitempty"`
	Context *string `json:"context,omitempty"`
	ID      *string `json:"id,omitempty"`
	Key     *string `json:"key,omitempty"`
	Symbol  *string `json:"symbol,omitempty"`
}

func (f *FilterPivot) GetTitle() *string {
	if f == nil {
		return nil
	}
	return f.Title
}

func (f *FilterPivot) GetType() *string {
	if f == nil {
		return nil
	}
	return f.Type
}

func (f *FilterPivot) GetContext() *string {
	if f == nil {
		return nil
	}
	return f.Context
}

func (f *FilterPivot) GetID() *string {
	if f == nil {
		return nil
	}
	return f.ID
}

func (f *FilterPivot) GetKey() *string {
	if f == nil {
		return nil
	}
	return f.Key
}

func (f *FilterPivot) GetSymbol() *string {
	if f == nil {
		return nil
	}
	return f.Symbol
}

// Filter - Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an important subset useful for top-level API.
type Filter struct {
	// The title for the filter.
	Title   *string `json:"title,omitempty"`
	Type    *string `json:"type,omitempty"`
	Art     *string `json:"art,omitempty"`
	Content *bool   `json:"content,omitempty"`
	// This represents the filter name used for the filter, which can be used to construct complex media queries with.
	Filter           *string `json:"filter,omitempty"`
	HasPrefs         *bool   `json:"hasPrefs,omitempty"`
	HasStoreServices *bool   `json:"hasStoreServices,omitempty"`
	HubKey           *string `json:"hubKey,omitempty"`
	Identifier       *string `json:"identifier,omitempty"`
	// This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
	Key            *string       `json:"key,omitempty"`
	LastAccessedAt *int64        `json:"lastAccessedAt,omitempty"`
	Pivot          []FilterPivot `json:"Pivot,omitempty"`
	Share          *int64        `json:"share,omitempty"`
	Thumb          *string       `json:"thumb,omitempty"`
	TitleBar       *string       `json:"titleBar,omitempty"`
	// This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
	FilterType           *string        `json:"filterType,omitempty"`
	AdditionalProperties map[string]any `additionalProperties:"true" json:"-"`
}

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

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

func (f *Filter) GetTitle() *string {
	if f == nil {
		return nil
	}
	return f.Title
}

func (f *Filter) GetType() *string {
	if f == nil {
		return nil
	}
	return f.Type
}

func (f *Filter) GetArt() *string {
	if f == nil {
		return nil
	}
	return f.Art
}

func (f *Filter) GetContent() *bool {
	if f == nil {
		return nil
	}
	return f.Content
}

func (f *Filter) GetFilter() *string {
	if f == nil {
		return nil
	}
	return f.Filter
}

func (f *Filter) GetHasPrefs() *bool {
	if f == nil {
		return nil
	}
	return f.HasPrefs
}

func (f *Filter) GetHasStoreServices() *bool {
	if f == nil {
		return nil
	}
	return f.HasStoreServices
}

func (f *Filter) GetHubKey() *string {
	if f == nil {
		return nil
	}
	return f.HubKey
}

func (f *Filter) GetIdentifier() *string {
	if f == nil {
		return nil
	}
	return f.Identifier
}

func (f *Filter) GetKey() *string {
	if f == nil {
		return nil
	}
	return f.Key
}

func (f *Filter) GetLastAccessedAt() *int64 {
	if f == nil {
		return nil
	}
	return f.LastAccessedAt
}

func (f *Filter) GetPivot() []FilterPivot {
	if f == nil {
		return nil
	}
	return f.Pivot
}

func (f *Filter) GetShare() *int64 {
	if f == nil {
		return nil
	}
	return f.Share
}

func (f *Filter) GetThumb() *string {
	if f == nil {
		return nil
	}
	return f.Thumb
}

func (f *Filter) GetTitleBar() *string {
	if f == nil {
		return nil
	}
	return f.TitleBar
}

func (f *Filter) GetFilterType() *string {
	if f == nil {
		return nil
	}
	return f.FilterType
}

func (f *Filter) GetAdditionalProperties() map[string]any {
	if f == nil {
		return nil
	}
	return f.AdditionalProperties
}
