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

package components

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

// Media - `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element.
type Media struct {
	AspectRatio           *float32       `json:"aspectRatio,omitempty"`
	AudioChannels         *int           `json:"audioChannels,omitempty"`
	AudioCodec            *string        `json:"audioCodec,omitempty"`
	AudioProfile          *string        `json:"audioProfile,omitempty"`
	Bitrate               *int           `json:"bitrate,omitempty"`
	Container             *string        `json:"container,omitempty"`
	Duration              *int           `json:"duration,omitempty"`
	Has64bitOffsets       *bool          `json:"has64bitOffsets,omitempty"`
	HasVoiceActivity      *bool          `json:"hasVoiceActivity,omitempty"`
	Height                *int           `json:"height,omitempty"`
	ID                    int64          `json:"id"`
	OptimizedForStreaming *bool          `json:"optimizedForStreaming,omitempty"`
	Part                  []Part         `json:"Part,omitempty"`
	VideoCodec            *string        `json:"videoCodec,omitempty"`
	VideoFrameRate        *string        `json:"videoFrameRate,omitempty"`
	VideoProfile          *string        `json:"videoProfile,omitempty"`
	VideoResolution       *string        `json:"videoResolution,omitempty"`
	Width                 *int           `json:"width,omitempty"`
	AdditionalProperties  map[string]any `additionalProperties:"true" json:"-"`
}

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

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

func (m *Media) GetAspectRatio() *float32 {
	if m == nil {
		return nil
	}
	return m.AspectRatio
}

func (m *Media) GetAudioChannels() *int {
	if m == nil {
		return nil
	}
	return m.AudioChannels
}

func (m *Media) GetAudioCodec() *string {
	if m == nil {
		return nil
	}
	return m.AudioCodec
}

func (m *Media) GetAudioProfile() *string {
	if m == nil {
		return nil
	}
	return m.AudioProfile
}

func (m *Media) GetBitrate() *int {
	if m == nil {
		return nil
	}
	return m.Bitrate
}

func (m *Media) GetContainer() *string {
	if m == nil {
		return nil
	}
	return m.Container
}

func (m *Media) GetDuration() *int {
	if m == nil {
		return nil
	}
	return m.Duration
}

func (m *Media) GetHas64bitOffsets() *bool {
	if m == nil {
		return nil
	}
	return m.Has64bitOffsets
}

func (m *Media) GetHasVoiceActivity() *bool {
	if m == nil {
		return nil
	}
	return m.HasVoiceActivity
}

func (m *Media) GetHeight() *int {
	if m == nil {
		return nil
	}
	return m.Height
}

func (m *Media) GetID() int64 {
	if m == nil {
		return 0
	}
	return m.ID
}

func (m *Media) GetOptimizedForStreaming() *bool {
	if m == nil {
		return nil
	}
	return m.OptimizedForStreaming
}

func (m *Media) GetPart() []Part {
	if m == nil {
		return nil
	}
	return m.Part
}

func (m *Media) GetVideoCodec() *string {
	if m == nil {
		return nil
	}
	return m.VideoCodec
}

func (m *Media) GetVideoFrameRate() *string {
	if m == nil {
		return nil
	}
	return m.VideoFrameRate
}

func (m *Media) GetVideoProfile() *string {
	if m == nil {
		return nil
	}
	return m.VideoProfile
}

func (m *Media) GetVideoResolution() *string {
	if m == nil {
		return nil
	}
	return m.VideoResolution
}

func (m *Media) GetWidth() *int {
	if m == nil {
		return nil
	}
	return m.Width
}

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