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

package components

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

// Stream - `Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream.  Note that photos do not have streams (mostly as an optimization).
type Stream struct {
	Default            *bool  `json:"default,omitempty"`
	AudioChannelLayout any    `json:"audioChannelLayout,omitempty"`
	BitDepth           *int64 `json:"bitDepth,omitempty"`
	Bitrate            *int64 `json:"bitrate,omitempty"`
	// For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video.
	CanAutoSync       *bool `json:"canAutoSync,omitempty"`
	ChromaLocation    any   `json:"chromaLocation,omitempty"`
	ChromaSubsampling any   `json:"chromaSubsampling,omitempty"`
	// The codec of the stream, such as `h264` or `aac`
	Codec          any `json:"codec,omitempty"`
	ColorPrimaries any `json:"colorPrimaries,omitempty"`
	ColorRange     any `json:"colorRange,omitempty"`
	ColorSpace     any `json:"colorSpace,omitempty"`
	ColorTrc       any `json:"colorTrc,omitempty"`
	// A friendly name for the stream, often comprised of the language and codec information
	DisplayTitle     any      `json:"displayTitle,omitempty"`
	FrameRate        *float64 `json:"frameRate,omitempty"`
	HasScalingMatrix any      `json:"hasScalingMatrix,omitempty"`
	Height           *int64   `json:"height,omitempty"`
	ID               *int64   `json:"id,omitempty"`
	// If the stream is part of the `Part` and not an external resource, the index of the stream within that part
	Index *int64 `json:"index,omitempty"`
	// If the stream is independently streamable, the key from which it can be streamed
	Key      any `json:"key,omitempty"`
	Language any `json:"language,omitempty"`
	// The three character language code for the stream contents
	LanguageCode     any    `json:"languageCode,omitempty"`
	Level            *int64 `json:"level,omitempty"`
	Profile          any    `json:"profile,omitempty"`
	RefFrames        *int64 `json:"refFrames,omitempty"`
	SamplingRate     *int64 `json:"samplingRate,omitempty"`
	Selected         *bool  `json:"selected,omitempty"`
	StreamIdentifier *int64 `json:"streamIdentifier,omitempty"`
	// A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics
	StreamType           *int64         `json:"streamType,omitempty"`
	Width                *int64         `json:"width,omitempty"`
	AdditionalProperties map[string]any `additionalProperties:"true" json:"-"`
}

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

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

func (s *Stream) GetDefault() *bool {
	if s == nil {
		return nil
	}
	return s.Default
}

func (s *Stream) GetAudioChannelLayout() any {
	if s == nil {
		return nil
	}
	return s.AudioChannelLayout
}

func (s *Stream) GetBitDepth() *int64 {
	if s == nil {
		return nil
	}
	return s.BitDepth
}

func (s *Stream) GetBitrate() *int64 {
	if s == nil {
		return nil
	}
	return s.Bitrate
}

func (s *Stream) GetCanAutoSync() *bool {
	if s == nil {
		return nil
	}
	return s.CanAutoSync
}

func (s *Stream) GetChromaLocation() any {
	if s == nil {
		return nil
	}
	return s.ChromaLocation
}

func (s *Stream) GetChromaSubsampling() any {
	if s == nil {
		return nil
	}
	return s.ChromaSubsampling
}

func (s *Stream) GetCodec() any {
	if s == nil {
		return nil
	}
	return s.Codec
}

func (s *Stream) GetColorPrimaries() any {
	if s == nil {
		return nil
	}
	return s.ColorPrimaries
}

func (s *Stream) GetColorRange() any {
	if s == nil {
		return nil
	}
	return s.ColorRange
}

func (s *Stream) GetColorSpace() any {
	if s == nil {
		return nil
	}
	return s.ColorSpace
}

func (s *Stream) GetColorTrc() any {
	if s == nil {
		return nil
	}
	return s.ColorTrc
}

func (s *Stream) GetDisplayTitle() any {
	if s == nil {
		return nil
	}
	return s.DisplayTitle
}

func (s *Stream) GetFrameRate() *float64 {
	if s == nil {
		return nil
	}
	return s.FrameRate
}

func (s *Stream) GetHasScalingMatrix() any {
	if s == nil {
		return nil
	}
	return s.HasScalingMatrix
}

func (s *Stream) GetHeight() *int64 {
	if s == nil {
		return nil
	}
	return s.Height
}

func (s *Stream) GetID() *int64 {
	if s == nil {
		return nil
	}
	return s.ID
}

func (s *Stream) GetIndex() *int64 {
	if s == nil {
		return nil
	}
	return s.Index
}

func (s *Stream) GetKey() any {
	if s == nil {
		return nil
	}
	return s.Key
}

func (s *Stream) GetLanguage() any {
	if s == nil {
		return nil
	}
	return s.Language
}

func (s *Stream) GetLanguageCode() any {
	if s == nil {
		return nil
	}
	return s.LanguageCode
}

func (s *Stream) GetLevel() *int64 {
	if s == nil {
		return nil
	}
	return s.Level
}

func (s *Stream) GetProfile() any {
	if s == nil {
		return nil
	}
	return s.Profile
}

func (s *Stream) GetRefFrames() *int64 {
	if s == nil {
		return nil
	}
	return s.RefFrames
}

func (s *Stream) GetSamplingRate() *int64 {
	if s == nil {
		return nil
	}
	return s.SamplingRate
}

func (s *Stream) GetSelected() *bool {
	if s == nil {
		return nil
	}
	return s.Selected
}

func (s *Stream) GetStreamIdentifier() *int64 {
	if s == nil {
		return nil
	}
	return s.StreamIdentifier
}

func (s *Stream) GetStreamType() *int64 {
	if s == nil {
		return nil
	}
	return s.StreamType
}

func (s *Stream) GetWidth() *int64 {
	if s == nil {
		return nil
	}
	return s.Width
}

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