// 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 } // 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 (c *CreatePlaylistRequest) GetTitle() string { if c == nil { return "" } return c.Title } func (c *CreatePlaylistRequest) GetType() CreatePlaylistQueryParamType { if c == nil { return CreatePlaylistQueryParamType("") } return c.Type } func (c *CreatePlaylistRequest) GetSmart() Smart { if c == nil { return Smart(0) } return c.Smart } func (c *CreatePlaylistRequest) GetURI() string { if c == nil { return "" } return c.URI } func (c *CreatePlaylistRequest) GetPlayQueueID() *float64 { if c == nil { return nil } return c.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 (c *CreatePlaylistMetadata) GetRatingKey() *string { if c == nil { return nil } return c.RatingKey } func (c *CreatePlaylistMetadata) GetKey() *string { if c == nil { return nil } return c.Key } func (c *CreatePlaylistMetadata) GetGUID() *string { if c == nil { return nil } return c.GUID } func (c *CreatePlaylistMetadata) GetType() *string { if c == nil { return nil } return c.Type } func (c *CreatePlaylistMetadata) GetTitle() *string { if c == nil { return nil } return c.Title } func (c *CreatePlaylistMetadata) GetSummary() *string { if c == nil { return nil } return c.Summary } func (c *CreatePlaylistMetadata) GetSmart() *bool { if c == nil { return nil } return c.Smart } func (c *CreatePlaylistMetadata) GetPlaylistType() *string { if c == nil { return nil } return c.PlaylistType } func (c *CreatePlaylistMetadata) GetIcon() *string { if c == nil { return nil } return c.Icon } func (c *CreatePlaylistMetadata) GetViewCount() *int { if c == nil { return nil } return c.ViewCount } func (c *CreatePlaylistMetadata) GetLastViewedAt() *int { if c == nil { return nil } return c.LastViewedAt } func (c *CreatePlaylistMetadata) GetLeafCount() *int { if c == nil { return nil } return c.LeafCount } func (c *CreatePlaylistMetadata) GetAddedAt() *int { if c == nil { return nil } return c.AddedAt } func (c *CreatePlaylistMetadata) GetUpdatedAt() *int { if c == nil { return nil } return c.UpdatedAt } func (c *CreatePlaylistMetadata) GetComposite() *string { if c == nil { return nil } return c.Composite } func (c *CreatePlaylistMetadata) GetDuration() *int { if c == nil { return nil } return c.Duration } type CreatePlaylistMediaContainer struct { Size *int `json:"size,omitempty"` Metadata []CreatePlaylistMetadata `json:"Metadata,omitempty"` } func (c *CreatePlaylistMediaContainer) GetSize() *int { if c == nil { return nil } return c.Size } func (c *CreatePlaylistMediaContainer) GetMetadata() []CreatePlaylistMetadata { if c == nil { return nil } return c.Metadata } // CreatePlaylistResponseBody - returns all playlists type CreatePlaylistResponseBody struct { MediaContainer *CreatePlaylistMediaContainer `json:"MediaContainer,omitempty"` } func (c *CreatePlaylistResponseBody) GetMediaContainer() *CreatePlaylistMediaContainer { if c == nil { return nil } return c.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 (c *CreatePlaylistResponse) GetContentType() string { if c == nil { return "" } return c.ContentType } func (c *CreatePlaylistResponse) GetStatusCode() int { if c == nil { return 0 } return c.StatusCode } func (c *CreatePlaylistResponse) GetRawResponse() *http.Response { if c == nil { return nil } return c.RawResponse } func (c *CreatePlaylistResponse) GetObject() *CreatePlaylistResponseBody { if c == nil { return nil } return c.Object }