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

package components

import (
	"encoding/json"
	"fmt"
)

type AiringsType string

const (
	AiringsTypeNewAiringsOnly      AiringsType = "New Airings Only"
	AiringsTypeNewAndRepeatAirings AiringsType = "New and Repeat Airings"
)

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

// MediaSubscription - A media subscription contains a representation of metadata desired to be recorded
type MediaSubscription struct {
	Title *string `json:"title,omitempty"`
	// The metadata type of the root item of the subscription
	Type        *int64       `json:"type,omitempty"`
	AiringsType *AiringsType `json:"airingsType,omitempty"`
	CreatedAt   *int64       `json:"createdAt,omitempty"`
	// Media Matching Hints
	Directory map[string]any `json:"Directory,omitempty"`
	// Only included if `includeStorage` is specified
	DurationTotal       *int64               `json:"durationTotal,omitempty"`
	Key                 *string              `json:"key,omitempty"`
	LibrarySectionTitle *string              `json:"librarySectionTitle,omitempty"`
	LocationPath        *string              `json:"locationPath,omitempty"`
	MediaGrabOperation  []MediaGrabOperation `json:"MediaGrabOperation,omitempty"`
	// Media Matching Hints
	Playlist map[string]any `json:"Playlist,omitempty"`
	Setting  []Setting      `json:"Setting,omitempty"`
	// Only included if `includeStorage` is specified
	StorageTotal *int64 `json:"storageTotal,omitempty"`
	// The library section id for where the item is to be recorded
	TargetLibrarySectionID *int64 `json:"targetLibrarySectionID,omitempty"`
	// The library section location id for where the item is to be recorded
	TargetSectionLocationID *int64 `json:"targetSectionLocationID,omitempty"`
	// Media Matching Hints
	Video map[string]any `json:"Video,omitempty"`
}

func (m *MediaSubscription) GetTitle() *string {
	if m == nil {
		return nil
	}
	return m.Title
}

func (m *MediaSubscription) GetType() *int64 {
	if m == nil {
		return nil
	}
	return m.Type
}

func (m *MediaSubscription) GetAiringsType() *AiringsType {
	if m == nil {
		return nil
	}
	return m.AiringsType
}

func (m *MediaSubscription) GetCreatedAt() *int64 {
	if m == nil {
		return nil
	}
	return m.CreatedAt
}

func (m *MediaSubscription) GetDirectory() map[string]any {
	if m == nil {
		return nil
	}
	return m.Directory
}

func (m *MediaSubscription) GetDurationTotal() *int64 {
	if m == nil {
		return nil
	}
	return m.DurationTotal
}

func (m *MediaSubscription) GetKey() *string {
	if m == nil {
		return nil
	}
	return m.Key
}

func (m *MediaSubscription) GetLibrarySectionTitle() *string {
	if m == nil {
		return nil
	}
	return m.LibrarySectionTitle
}

func (m *MediaSubscription) GetLocationPath() *string {
	if m == nil {
		return nil
	}
	return m.LocationPath
}

func (m *MediaSubscription) GetMediaGrabOperation() []MediaGrabOperation {
	if m == nil {
		return nil
	}
	return m.MediaGrabOperation
}

func (m *MediaSubscription) GetPlaylist() map[string]any {
	if m == nil {
		return nil
	}
	return m.Playlist
}

func (m *MediaSubscription) GetSetting() []Setting {
	if m == nil {
		return nil
	}
	return m.Setting
}

func (m *MediaSubscription) GetStorageTotal() *int64 {
	if m == nil {
		return nil
	}
	return m.StorageTotal
}

func (m *MediaSubscription) GetTargetLibrarySectionID() *int64 {
	if m == nil {
		return nil
	}
	return m.TargetLibrarySectionID
}

func (m *MediaSubscription) GetTargetSectionLocationID() *int64 {
	if m == nil {
		return nil
	}
	return m.TargetSectionLocationID
}

func (m *MediaSubscription) GetVideo() map[string]any {
	if m == nil {
		return nil
	}
	return m.Video
}
