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

package operations

import (
	"encoding/json"
	"fmt"
	"github.com/LukeHagar/plexgo/internal/utils"
	"github.com/LukeHagar/plexgo/models/components"
	"net/http"
)

type WriteMessageGlobals struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
}

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

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

func (w *WriteMessageGlobals) GetAccepts() *components.Accepts {
	if w == nil {
		return nil
	}
	return w.Accepts
}

func (w *WriteMessageGlobals) GetClientIdentifier() *string {
	if w == nil {
		return nil
	}
	return w.ClientIdentifier
}

func (w *WriteMessageGlobals) GetProduct() *string {
	if w == nil {
		return nil
	}
	return w.Product
}

func (w *WriteMessageGlobals) GetVersion() *string {
	if w == nil {
		return nil
	}
	return w.Version
}

func (w *WriteMessageGlobals) GetPlatform() *string {
	if w == nil {
		return nil
	}
	return w.Platform
}

func (w *WriteMessageGlobals) GetPlatformVersion() *string {
	if w == nil {
		return nil
	}
	return w.PlatformVersion
}

func (w *WriteMessageGlobals) GetDevice() *string {
	if w == nil {
		return nil
	}
	return w.Device
}

func (w *WriteMessageGlobals) GetModel() *string {
	if w == nil {
		return nil
	}
	return w.Model
}

func (w *WriteMessageGlobals) GetDeviceVendor() *string {
	if w == nil {
		return nil
	}
	return w.DeviceVendor
}

func (w *WriteMessageGlobals) GetDeviceName() *string {
	if w == nil {
		return nil
	}
	return w.DeviceName
}

func (w *WriteMessageGlobals) GetMarketplace() *string {
	if w == nil {
		return nil
	}
	return w.Marketplace
}

// Level - An integer log level to write to the PMS log with.
//   - 0: Error
//   - 1: Warning
//   - 2: Info
//   - 3: Debug
//   - 4: Verbose
type Level int64

const (
	LevelZero  Level = 0
	LevelOne   Level = 1
	LevelTwo   Level = 2
	LevelThree Level = 3
	LevelFour  Level = 4
)

func (e Level) ToPointer() *Level {
	return &e
}
func (e *Level) UnmarshalJSON(data []byte) error {
	var v int64
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case 0:
		fallthrough
	case 1:
		fallthrough
	case 2:
		fallthrough
	case 3:
		fallthrough
	case 4:
		*e = Level(v)
		return nil
	default:
		return fmt.Errorf("invalid value for Level: %v", v)
	}
}

type WriteMessageRequest struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
	// An integer log level to write to the PMS log with.
	//   - 0: Error
	//   - 1: Warning
	//   - 2: Info
	//   - 3: Debug
	//   - 4: Verbose
	//
	Level *Level `queryParam:"style=form,explode=true,name=level"`
	// The text of the message to write to the log.
	Message *string `queryParam:"style=form,explode=true,name=message"`
	// A string indicating the source of the message.
	Source *string `queryParam:"style=form,explode=true,name=source"`
}

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

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

func (w *WriteMessageRequest) GetAccepts() *components.Accepts {
	if w == nil {
		return nil
	}
	return w.Accepts
}

func (w *WriteMessageRequest) GetClientIdentifier() *string {
	if w == nil {
		return nil
	}
	return w.ClientIdentifier
}

func (w *WriteMessageRequest) GetProduct() *string {
	if w == nil {
		return nil
	}
	return w.Product
}

func (w *WriteMessageRequest) GetVersion() *string {
	if w == nil {
		return nil
	}
	return w.Version
}

func (w *WriteMessageRequest) GetPlatform() *string {
	if w == nil {
		return nil
	}
	return w.Platform
}

func (w *WriteMessageRequest) GetPlatformVersion() *string {
	if w == nil {
		return nil
	}
	return w.PlatformVersion
}

func (w *WriteMessageRequest) GetDevice() *string {
	if w == nil {
		return nil
	}
	return w.Device
}

func (w *WriteMessageRequest) GetModel() *string {
	if w == nil {
		return nil
	}
	return w.Model
}

func (w *WriteMessageRequest) GetDeviceVendor() *string {
	if w == nil {
		return nil
	}
	return w.DeviceVendor
}

func (w *WriteMessageRequest) GetDeviceName() *string {
	if w == nil {
		return nil
	}
	return w.DeviceName
}

func (w *WriteMessageRequest) GetMarketplace() *string {
	if w == nil {
		return nil
	}
	return w.Marketplace
}

func (w *WriteMessageRequest) GetLevel() *Level {
	if w == nil {
		return nil
	}
	return w.Level
}

func (w *WriteMessageRequest) GetMessage() *string {
	if w == nil {
		return nil
	}
	return w.Message
}

func (w *WriteMessageRequest) GetSource() *string {
	if w == nil {
		return nil
	}
	return w.Source
}

type WriteMessageResponse struct {
	// HTTP response content type for this operation
	ContentType string
	// HTTP response status code for this operation
	StatusCode int
	// Raw HTTP response; suitable for custom response parsing
	RawResponse *http.Response
}

func (w *WriteMessageResponse) GetContentType() string {
	if w == nil {
		return ""
	}
	return w.ContentType
}

func (w *WriteMessageResponse) GetStatusCode() int {
	if w == nil {
		return 0
	}
	return w.StatusCode
}

func (w *WriteMessageResponse) GetRawResponse() *http.Response {
	if w == nil {
		return nil
	}
	return w.RawResponse
}
