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

package components

import (
	"encoding/json"
	"fmt"
)

// SessionLocation - The location of the client
type SessionLocation string

const (
	SessionLocationLan SessionLocation = "lan"
	SessionLocationWan SessionLocation = "wan"
)

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

// Session - Information about the playback session
type Session struct {
	// The bandwidth used by this client's playback in kbps
	Bandwidth *int64 `json:"bandwidth,omitempty"`
	// The id of the playback session
	ID *string `json:"id,omitempty"`
	// The location of the client
	Location *SessionLocation `json:"location,omitempty"`
}

func (s *Session) GetBandwidth() *int64 {
	if s == nil {
		return nil
	}
	return s.Bandwidth
}

func (s *Session) GetID() *string {
	if s == nil {
		return nil
	}
	return s.ID
}

func (s *Session) GetLocation() *SessionLocation {
	if s == nil {
		return nil
	}
	return s.Location
}
