// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. package operations import ( "encoding/json" "fmt" "net/http" ) // QueryParamType - type of playlist to create type QueryParamType string const ( QueryParamTypeAudio QueryParamType = "audio" QueryParamTypeVideo QueryParamType = "video" QueryParamTypePhoto QueryParamType = "photo" ) func (e QueryParamType) ToPointer() *QueryParamType { return &e } func (e *QueryParamType) 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 = QueryParamType(v) return nil default: return fmt.Errorf("invalid value for QueryParamType: %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 QueryParamType `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() QueryParamType { if o == nil { return QueryParamType("") } 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 CreatePlaylistErrors struct { Code *float64 `json:"code,omitempty"` Message *string `json:"message,omitempty"` Status *float64 `json:"status,omitempty"` } func (o *CreatePlaylistErrors) GetCode() *float64 { if o == nil { return nil } return o.Code } func (o *CreatePlaylistErrors) GetMessage() *string { if o == nil { return nil } return o.Message } func (o *CreatePlaylistErrors) GetStatus() *float64 { if o == nil { return nil } return o.Status } // CreatePlaylistPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. type CreatePlaylistPlaylistsResponseBody struct { Errors []CreatePlaylistErrors `json:"errors,omitempty"` } func (o *CreatePlaylistPlaylistsResponseBody) GetErrors() []CreatePlaylistErrors { if o == nil { return nil } return o.Errors } 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 TwoHundredApplicationJSONObject *CreatePlaylistResponseBody // Unauthorized - Returned if the X-Plex-Token is missing from the header or query. FourHundredAndOneApplicationJSONObject *CreatePlaylistPlaylistsResponseBody } 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) GetTwoHundredApplicationJSONObject() *CreatePlaylistResponseBody { if o == nil { return nil } return o.TwoHundredApplicationJSONObject } func (o *CreatePlaylistResponse) GetFourHundredAndOneApplicationJSONObject() *CreatePlaylistPlaylistsResponseBody { if o == nil { return nil } return o.FourHundredAndOneApplicationJSONObject }