mirror of
https://github.com/LukeHagar/plexterraform.git
synced 2025-12-06 12:37:47 +00:00
691 lines
15 KiB
Go
691 lines
15 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/internal/utils"
|
|
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/types"
|
|
"net/http"
|
|
)
|
|
|
|
var GetWatchlistServerList = []string{
|
|
"https://metadata.provider.plex.tv",
|
|
}
|
|
|
|
// PathParamFilter - Filter
|
|
type PathParamFilter string
|
|
|
|
const (
|
|
PathParamFilterAll PathParamFilter = "all"
|
|
PathParamFilterAvailable PathParamFilter = "available"
|
|
PathParamFilterReleased PathParamFilter = "released"
|
|
)
|
|
|
|
func (e PathParamFilter) ToPointer() *PathParamFilter {
|
|
return &e
|
|
}
|
|
func (e *PathParamFilter) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "all":
|
|
fallthrough
|
|
case "available":
|
|
fallthrough
|
|
case "released":
|
|
*e = PathParamFilter(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for PathParamFilter: %v", v)
|
|
}
|
|
}
|
|
|
|
// Libtype - The type of library to filter. Can be "movie" or "show", or all if not present.
|
|
type Libtype string
|
|
|
|
const (
|
|
LibtypeMovie Libtype = "movie"
|
|
LibtypeShow Libtype = "show"
|
|
)
|
|
|
|
func (e Libtype) ToPointer() *Libtype {
|
|
return &e
|
|
}
|
|
func (e *Libtype) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "movie":
|
|
fallthrough
|
|
case "show":
|
|
*e = Libtype(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for Libtype: %v", v)
|
|
}
|
|
}
|
|
|
|
// IncludeCollections - include collections in the results
|
|
type IncludeCollections int64
|
|
|
|
const (
|
|
IncludeCollectionsOne IncludeCollections = 1
|
|
IncludeCollectionsZero IncludeCollections = 0
|
|
)
|
|
|
|
func (e IncludeCollections) ToPointer() *IncludeCollections {
|
|
return &e
|
|
}
|
|
func (e *IncludeCollections) UnmarshalJSON(data []byte) error {
|
|
var v int64
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case 1:
|
|
fallthrough
|
|
case 0:
|
|
*e = IncludeCollections(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for IncludeCollections: %v", v)
|
|
}
|
|
}
|
|
|
|
// IncludeExternalMedia - include external media in the results
|
|
type IncludeExternalMedia int64
|
|
|
|
const (
|
|
IncludeExternalMediaOne IncludeExternalMedia = 1
|
|
IncludeExternalMediaZero IncludeExternalMedia = 0
|
|
)
|
|
|
|
func (e IncludeExternalMedia) ToPointer() *IncludeExternalMedia {
|
|
return &e
|
|
}
|
|
func (e *IncludeExternalMedia) UnmarshalJSON(data []byte) error {
|
|
var v int64
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case 1:
|
|
fallthrough
|
|
case 0:
|
|
*e = IncludeExternalMedia(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for IncludeExternalMedia: %v", v)
|
|
}
|
|
}
|
|
|
|
type GetWatchlistRequest struct {
|
|
// Filter
|
|
Filter PathParamFilter `pathParam:"style=simple,explode=false,name=filter"`
|
|
// In the format "field:dir". Available fields are "watchlistedAt" (Added At),
|
|
// "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
|
|
// "dir" can be "asc" or "desc"
|
|
//
|
|
Sort *string `queryParam:"style=form,explode=true,name=sort"`
|
|
// The type of library to filter. Can be "movie" or "show", or all if not present.
|
|
//
|
|
Libtype *Libtype `queryParam:"style=form,explode=true,name=libtype"`
|
|
// The number of items to return. If not specified, all items will be returned.
|
|
// If the number of items exceeds the limit, the response will be paginated.
|
|
//
|
|
Maxresults *int `queryParam:"style=form,explode=true,name=maxresults"`
|
|
// include collections in the results
|
|
//
|
|
IncludeCollections *IncludeCollections `queryParam:"style=form,explode=true,name=includeCollections"`
|
|
// include external media in the results
|
|
//
|
|
IncludeExternalMedia *IncludeExternalMedia `queryParam:"style=form,explode=true,name=includeExternalMedia"`
|
|
// User Token
|
|
XPlexToken string `queryParam:"style=form,explode=true,name=X-Plex-Token"`
|
|
// The index of the first item to return. If not specified, the first item will be returned.
|
|
// If the number of items exceeds the limit, the response will be paginated.
|
|
//
|
|
XPlexContainerStart *int `queryParam:"style=form,explode=true,name=X-Plex-Container-Start"`
|
|
// The number of items to return. If not specified, all items will be returned.
|
|
// If the number of items exceeds the limit, the response will be paginated.
|
|
//
|
|
XPlexContainerSize *int `queryParam:"style=form,explode=true,name=X-Plex-Container-Size"`
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetFilter() PathParamFilter {
|
|
if o == nil {
|
|
return PathParamFilter("")
|
|
}
|
|
return o.Filter
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetSort() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Sort
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetLibtype() *Libtype {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Libtype
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetMaxresults() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Maxresults
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetIncludeCollections() *IncludeCollections {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.IncludeCollections
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetIncludeExternalMedia() *IncludeExternalMedia {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.IncludeExternalMedia
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetXPlexToken() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.XPlexToken
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetXPlexContainerStart() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.XPlexContainerStart
|
|
}
|
|
|
|
func (o *GetWatchlistRequest) GetXPlexContainerSize() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.XPlexContainerSize
|
|
}
|
|
|
|
type GetWatchlistErrors struct {
|
|
Code *float64 `json:"code,omitempty"`
|
|
Message *string `json:"message,omitempty"`
|
|
Status *float64 `json:"status,omitempty"`
|
|
}
|
|
|
|
func (o *GetWatchlistErrors) GetCode() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GetWatchlistErrors) GetMessage() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Message
|
|
}
|
|
|
|
func (o *GetWatchlistErrors) GetStatus() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Status
|
|
}
|
|
|
|
// GetWatchlistWatchlistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
type GetWatchlistWatchlistResponseBody struct {
|
|
Errors []GetWatchlistErrors `json:"errors,omitempty"`
|
|
}
|
|
|
|
func (o *GetWatchlistWatchlistResponseBody) GetErrors() []GetWatchlistErrors {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Errors
|
|
}
|
|
|
|
type Image struct {
|
|
Alt *string `json:"alt,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
URL *string `json:"url,omitempty"`
|
|
}
|
|
|
|
func (o *Image) GetAlt() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Alt
|
|
}
|
|
|
|
func (o *Image) GetType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
func (o *Image) GetURL() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.URL
|
|
}
|
|
|
|
type Metadata struct {
|
|
Art *string `json:"art,omitempty"`
|
|
GUID *string `json:"guid,omitempty"`
|
|
Key *string `json:"key,omitempty"`
|
|
RatingKey *string `json:"ratingKey,omitempty"`
|
|
Studio *string `json:"studio,omitempty"`
|
|
Tagline *string `json:"tagline,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
Thumb *string `json:"thumb,omitempty"`
|
|
AddedAt *int `json:"addedAt,omitempty"`
|
|
Duration *int `json:"duration,omitempty"`
|
|
PublicPagesURL *string `json:"publicPagesURL,omitempty"`
|
|
Slug *string `json:"slug,omitempty"`
|
|
UserState *bool `json:"userState,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
ContentRating *string `json:"contentRating,omitempty"`
|
|
OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"`
|
|
Year *int `json:"year,omitempty"`
|
|
Image []Image `json:"Image,omitempty"`
|
|
Banner *string `json:"banner,omitempty"`
|
|
Rating *float64 `json:"rating,omitempty"`
|
|
ExpiresAt *int `json:"expiresAt,omitempty"`
|
|
OriginalTitle *string `json:"originalTitle,omitempty"`
|
|
AudienceRating *float64 `json:"audienceRating,omitempty"`
|
|
AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
|
|
RatingImage *string `json:"ratingImage,omitempty"`
|
|
ImdbRatingCount *int `json:"imdbRatingCount,omitempty"`
|
|
Subtype *string `json:"subtype,omitempty"`
|
|
Theme *string `json:"theme,omitempty"`
|
|
LeafCount *int `json:"leafCount,omitempty"`
|
|
ChildCount *int `json:"childCount,omitempty"`
|
|
IsContinuingSeries *bool `json:"isContinuingSeries,omitempty"`
|
|
SkipChildren *bool `json:"skipChildren,omitempty"`
|
|
AvailabilityID *string `json:"availabilityId,omitempty"`
|
|
StreamingMediaID *string `json:"streamingMediaId,omitempty"`
|
|
PlayableKey *string `json:"playableKey,omitempty"`
|
|
}
|
|
|
|
func (m Metadata) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(m, "", false)
|
|
}
|
|
|
|
func (m *Metadata) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *Metadata) GetArt() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Art
|
|
}
|
|
|
|
func (o *Metadata) GetGUID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.GUID
|
|
}
|
|
|
|
func (o *Metadata) GetKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Key
|
|
}
|
|
|
|
func (o *Metadata) GetRatingKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RatingKey
|
|
}
|
|
|
|
func (o *Metadata) GetStudio() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Studio
|
|
}
|
|
|
|
func (o *Metadata) GetTagline() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Tagline
|
|
}
|
|
|
|
func (o *Metadata) GetType() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Type
|
|
}
|
|
|
|
func (o *Metadata) GetThumb() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Thumb
|
|
}
|
|
|
|
func (o *Metadata) GetAddedAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AddedAt
|
|
}
|
|
|
|
func (o *Metadata) GetDuration() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Duration
|
|
}
|
|
|
|
func (o *Metadata) GetPublicPagesURL() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PublicPagesURL
|
|
}
|
|
|
|
func (o *Metadata) GetSlug() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Slug
|
|
}
|
|
|
|
func (o *Metadata) GetUserState() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.UserState
|
|
}
|
|
|
|
func (o *Metadata) GetTitle() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Title
|
|
}
|
|
|
|
func (o *Metadata) GetContentRating() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ContentRating
|
|
}
|
|
|
|
func (o *Metadata) GetOriginallyAvailableAt() *types.Date {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.OriginallyAvailableAt
|
|
}
|
|
|
|
func (o *Metadata) GetYear() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Year
|
|
}
|
|
|
|
func (o *Metadata) GetImage() []Image {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Image
|
|
}
|
|
|
|
func (o *Metadata) GetBanner() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Banner
|
|
}
|
|
|
|
func (o *Metadata) GetRating() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Rating
|
|
}
|
|
|
|
func (o *Metadata) GetExpiresAt() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ExpiresAt
|
|
}
|
|
|
|
func (o *Metadata) GetOriginalTitle() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.OriginalTitle
|
|
}
|
|
|
|
func (o *Metadata) GetAudienceRating() *float64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AudienceRating
|
|
}
|
|
|
|
func (o *Metadata) GetAudienceRatingImage() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AudienceRatingImage
|
|
}
|
|
|
|
func (o *Metadata) GetRatingImage() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RatingImage
|
|
}
|
|
|
|
func (o *Metadata) GetImdbRatingCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ImdbRatingCount
|
|
}
|
|
|
|
func (o *Metadata) GetSubtype() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Subtype
|
|
}
|
|
|
|
func (o *Metadata) GetTheme() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Theme
|
|
}
|
|
|
|
func (o *Metadata) GetLeafCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LeafCount
|
|
}
|
|
|
|
func (o *Metadata) GetChildCount() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ChildCount
|
|
}
|
|
|
|
func (o *Metadata) GetIsContinuingSeries() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.IsContinuingSeries
|
|
}
|
|
|
|
func (o *Metadata) GetSkipChildren() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.SkipChildren
|
|
}
|
|
|
|
func (o *Metadata) GetAvailabilityID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AvailabilityID
|
|
}
|
|
|
|
func (o *Metadata) GetStreamingMediaID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.StreamingMediaID
|
|
}
|
|
|
|
func (o *Metadata) GetPlayableKey() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.PlayableKey
|
|
}
|
|
|
|
// GetWatchlistResponseBody - Watchlist Data
|
|
type GetWatchlistResponseBody struct {
|
|
LibrarySectionID *string `json:"librarySectionID,omitempty"`
|
|
LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"`
|
|
Offset *int `json:"offset,omitempty"`
|
|
TotalSize *int `json:"totalSize,omitempty"`
|
|
Identifier *string `json:"identifier,omitempty"`
|
|
Size *int `json:"size,omitempty"`
|
|
Metadata []Metadata `json:"Metadata,omitempty"`
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetLibrarySectionID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LibrarySectionID
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetLibrarySectionTitle() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.LibrarySectionTitle
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetOffset() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Offset
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetTotalSize() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.TotalSize
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetIdentifier() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Identifier
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetSize() *int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Size
|
|
}
|
|
|
|
func (o *GetWatchlistResponseBody) GetMetadata() []Metadata {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
type GetWatchlistResponse 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
|
|
// Watchlist Data
|
|
TwoHundredApplicationJSONObject *GetWatchlistResponseBody
|
|
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
FourHundredAndOneApplicationJSONObject *GetWatchlistWatchlistResponseBody
|
|
}
|
|
|
|
func (o *GetWatchlistResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *GetWatchlistResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *GetWatchlistResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *GetWatchlistResponse) GetTwoHundredApplicationJSONObject() *GetWatchlistResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.TwoHundredApplicationJSONObject
|
|
}
|
|
|
|
func (o *GetWatchlistResponse) GetFourHundredAndOneApplicationJSONObject() *GetWatchlistWatchlistResponseBody {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.FourHundredAndOneApplicationJSONObject
|
|
}
|