Files
plexterraform/internal/sdk/models/operations/logline.go

166 lines
3.0 KiB
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"net/http"
)
// 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 LogLineRequest struct {
// 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 (o *LogLineRequest) GetLevel() Level {
if o == nil {
return Level(0)
}
return o.Level
}
func (o *LogLineRequest) GetMessage() string {
if o == nil {
return ""
}
return o.Message
}
func (o *LogLineRequest) GetSource() string {
if o == nil {
return ""
}
return o.Source
}
type LogLineErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Status *float64 `json:"status,omitempty"`
}
func (o *LogLineErrors) GetCode() *float64 {
if o == nil {
return nil
}
return o.Code
}
func (o *LogLineErrors) GetMessage() *string {
if o == nil {
return nil
}
return o.Message
}
func (o *LogLineErrors) GetStatus() *float64 {
if o == nil {
return nil
}
return o.Status
}
// LogLineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
type LogLineResponseBody struct {
Errors []LogLineErrors `json:"errors,omitempty"`
}
func (o *LogLineResponseBody) GetErrors() []LogLineErrors {
if o == nil {
return nil
}
return o.Errors
}
type LogLineResponse 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
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
Object *LogLineResponseBody
}
func (o *LogLineResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *LogLineResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *LogLineResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *LogLineResponse) GetObject() *LogLineResponseBody {
if o == nil {
return nil
}
return o.Object
}