mirror of
https://github.com/LukeHagar/plexterraform.git
synced 2025-12-06 12:37:47 +00:00
337 lines
6.9 KiB
Go
337 lines
6.9 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// PlaylistType - limit to a type of playlist.
|
|
type PlaylistType string
|
|
|
|
const (
|
|
PlaylistTypeAudio PlaylistType = "audio"
|
|
PlaylistTypeVideo PlaylistType = "video"
|
|
PlaylistTypePhoto PlaylistType = "photo"
|
|
)
|
|
|
|
func (e PlaylistType) ToPointer() *PlaylistType {
|
|
return &e
|
|
}
|
|
func (e *PlaylistType) 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 = PlaylistType(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for PlaylistType: %v", v)
|
|
}
|
|
}
|
|
|
|
// QueryParamSmart - type of playlists to return (default is all).
|
|
type QueryParamSmart int64
|
|
|
|
const (
|
|
QueryParamSmartZero QueryParamSmart = 0
|
|
QueryParamSmartOne QueryParamSmart = 1
|
|
)
|
|
|
|
func (e QueryParamSmart) ToPointer() *QueryParamSmart {
|
|
return &e
|
|
}
|
|
func (e *QueryParamSmart) 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 = QueryParamSmart(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for QueryParamSmart: %v", v)
|
|
}
|
|
}
|
|
|
|
type GetPlaylistsRequest struct {
|
|
// limit to a type of playlist.
|
|
PlaylistType *PlaylistType `queryParam:"style=form,explode=true,name=playlistType"`
|
|
// type of playlists to return (default is all).
|
|
Smart *QueryParamSmart `queryParam:"style=form,explode=true,name=smart"`
|
|
}
|
|
|
|
func (o *GetPlaylistsRequest) GetPlaylistType() *PlaylistType {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PlaylistType
|
|
}
|
|
|
|
func (o *GetPlaylistsRequest) GetSmart() *QueryParamSmart {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Smart
|
|
}
|
|
|
|
type GetPlaylistsErrors struct {
|
|
Code *float64 `json:"code,omitempty"`
|
|
Message *string `json:"message,omitempty"`
|
|
Status *float64 `json:"status,omitempty"`
|
|
}
|
|
|
|
func (o *GetPlaylistsErrors) GetCode() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GetPlaylistsErrors) GetMessage() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Message
|
|
}
|
|
|
|
func (o *GetPlaylistsErrors) GetStatus() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Status
|
|
}
|
|
|
|
// GetPlaylistsPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
type GetPlaylistsPlaylistsResponseBody struct {
|
|
Errors []GetPlaylistsErrors `json:"errors,omitempty"`
|
|
}
|
|
|
|
func (o *GetPlaylistsPlaylistsResponseBody) GetErrors() []GetPlaylistsErrors {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Errors
|
|
}
|
|
|
|
type GetPlaylistsMetadata 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"`
|
|
Composite *string `json:"composite,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
ViewCount *int `json:"viewCount,omitempty"`
|
|
LastViewedAt *int `json:"lastViewedAt,omitempty"`
|
|
Duration *int `json:"duration,omitempty"`
|
|
LeafCount *int `json:"leafCount,omitempty"`
|
|
AddedAt *int `json:"addedAt,omitempty"`
|
|
UpdatedAt *int `json:"updatedAt,omitempty"`
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetRatingKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RatingKey
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Key
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetGUID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.GUID
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetTitle() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Title
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetSummary() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Summary
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetSmart() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Smart
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetPlaylistType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PlaylistType
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetComposite() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Composite
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetIcon() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Icon
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetViewCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ViewCount
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetLastViewedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LastViewedAt
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetDuration() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Duration
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetLeafCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LeafCount
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetAddedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AddedAt
|
|
}
|
|
|
|
func (o *GetPlaylistsMetadata) GetUpdatedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.UpdatedAt
|
|
}
|
|
|
|
type GetPlaylistsMediaContainer struct {
|
|
Size *int `json:"size,omitempty"`
|
|
Metadata []GetPlaylistsMetadata `json:"Metadata,omitempty"`
|
|
}
|
|
|
|
func (o *GetPlaylistsMediaContainer) GetSize() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Size
|
|
}
|
|
|
|
func (o *GetPlaylistsMediaContainer) GetMetadata() []GetPlaylistsMetadata {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
// GetPlaylistsResponseBody - returns all playlists
|
|
type GetPlaylistsResponseBody struct {
|
|
MediaContainer *GetPlaylistsMediaContainer `json:"MediaContainer,omitempty"`
|
|
}
|
|
|
|
func (o *GetPlaylistsResponseBody) GetMediaContainer() *GetPlaylistsMediaContainer {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.MediaContainer
|
|
}
|
|
|
|
type GetPlaylistsResponse 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 *GetPlaylistsResponseBody
|
|
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
FourHundredAndOneApplicationJSONObject *GetPlaylistsPlaylistsResponseBody
|
|
}
|
|
|
|
func (o *GetPlaylistsResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *GetPlaylistsResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *GetPlaylistsResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *GetPlaylistsResponse) GetTwoHundredApplicationJSONObject() *GetPlaylistsResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.TwoHundredApplicationJSONObject
|
|
}
|
|
|
|
func (o *GetPlaylistsResponse) GetFourHundredAndOneApplicationJSONObject() *GetPlaylistsPlaylistsResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.FourHundredAndOneApplicationJSONObject
|
|
}
|