mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
316 lines
6.4 KiB
Go
316 lines
6.4 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// CreatePlaylistQueryParamType - type of playlist to create
|
|
type CreatePlaylistQueryParamType string
|
|
|
|
const (
|
|
CreatePlaylistQueryParamTypeAudio CreatePlaylistQueryParamType = "audio"
|
|
CreatePlaylistQueryParamTypeVideo CreatePlaylistQueryParamType = "video"
|
|
CreatePlaylistQueryParamTypePhoto CreatePlaylistQueryParamType = "photo"
|
|
)
|
|
|
|
func (e CreatePlaylistQueryParamType) ToPointer() *CreatePlaylistQueryParamType {
|
|
return &e
|
|
}
|
|
func (e *CreatePlaylistQueryParamType) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "audio":
|
|
fallthrough
|
|
case "video":
|
|
fallthrough
|
|
case "photo":
|
|
*e = CreatePlaylistQueryParamType(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for CreatePlaylistQueryParamType: %v", v)
|
|
}
|
|
}
|
|
|
|
// Smart - whether the playlist is smart or not
|
|
type Smart int64
|
|
|
|
const (
|
|
SmartZero Smart = 0
|
|
SmartOne Smart = 1
|
|
)
|
|
|
|
func (e Smart) ToPointer() *Smart {
|
|
return &e
|
|
}
|
|
func (e *Smart) UnmarshalJSON(data []byte) error {
|
|
var v int64
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case 0:
|
|
fallthrough
|
|
case 1:
|
|
*e = Smart(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for Smart: %v", v)
|
|
}
|
|
}
|
|
|
|
type CreatePlaylistRequest struct {
|
|
// name of the playlist
|
|
Title string `queryParam:"style=form,explode=true,name=title"`
|
|
// type of playlist to create
|
|
Type CreatePlaylistQueryParamType `queryParam:"style=form,explode=true,name=type"`
|
|
// whether the playlist is smart or not
|
|
Smart Smart `queryParam:"style=form,explode=true,name=smart"`
|
|
// the content URI for the playlist
|
|
URI string `queryParam:"style=form,explode=true,name=uri"`
|
|
// the play queue to copy to a playlist
|
|
PlayQueueID *float64 `queryParam:"style=form,explode=true,name=playQueueID"`
|
|
}
|
|
|
|
func (o *CreatePlaylistRequest) GetTitle() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Title
|
|
}
|
|
|
|
func (o *CreatePlaylistRequest) GetType() CreatePlaylistQueryParamType {
|
|
if o == nil {
|
|
return CreatePlaylistQueryParamType("")
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
func (o *CreatePlaylistRequest) GetSmart() Smart {
|
|
if o == nil {
|
|
return Smart(0)
|
|
}
|
|
return o.Smart
|
|
}
|
|
|
|
func (o *CreatePlaylistRequest) GetURI() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.URI
|
|
}
|
|
|
|
func (o *CreatePlaylistRequest) GetPlayQueueID() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PlayQueueID
|
|
}
|
|
|
|
type CreatePlaylistMetadata struct {
|
|
RatingKey *string `json:"ratingKey,omitempty"`
|
|
Key *string `json:"key,omitempty"`
|
|
GUID *string `json:"guid,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
Summary *string `json:"summary,omitempty"`
|
|
Smart *bool `json:"smart,omitempty"`
|
|
PlaylistType *string `json:"playlistType,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
ViewCount *int `json:"viewCount,omitempty"`
|
|
LastViewedAt *int `json:"lastViewedAt,omitempty"`
|
|
LeafCount *int `json:"leafCount,omitempty"`
|
|
AddedAt *int `json:"addedAt,omitempty"`
|
|
UpdatedAt *int `json:"updatedAt,omitempty"`
|
|
Composite *string `json:"composite,omitempty"`
|
|
Duration *int `json:"duration,omitempty"`
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetRatingKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RatingKey
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Key
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetGUID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.GUID
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetTitle() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Title
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetSummary() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Summary
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetSmart() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Smart
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetPlaylistType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PlaylistType
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetIcon() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Icon
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetViewCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ViewCount
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetLastViewedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LastViewedAt
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetLeafCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LeafCount
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetAddedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AddedAt
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetUpdatedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.UpdatedAt
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetComposite() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Composite
|
|
}
|
|
|
|
func (o *CreatePlaylistMetadata) GetDuration() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Duration
|
|
}
|
|
|
|
type CreatePlaylistMediaContainer struct {
|
|
Size *int `json:"size,omitempty"`
|
|
Metadata []CreatePlaylistMetadata `json:"Metadata,omitempty"`
|
|
}
|
|
|
|
func (o *CreatePlaylistMediaContainer) GetSize() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Size
|
|
}
|
|
|
|
func (o *CreatePlaylistMediaContainer) GetMetadata() []CreatePlaylistMetadata {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
// CreatePlaylistResponseBody - returns all playlists
|
|
type CreatePlaylistResponseBody struct {
|
|
MediaContainer *CreatePlaylistMediaContainer `json:"MediaContainer,omitempty"`
|
|
}
|
|
|
|
func (o *CreatePlaylistResponseBody) GetMediaContainer() *CreatePlaylistMediaContainer {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.MediaContainer
|
|
}
|
|
|
|
type CreatePlaylistResponse 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
|
|
// returns all playlists
|
|
Object *CreatePlaylistResponseBody
|
|
}
|
|
|
|
func (o *CreatePlaylistResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *CreatePlaylistResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *CreatePlaylistResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *CreatePlaylistResponse) GetObject() *CreatePlaylistResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Object
|
|
}
|