// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. package operations import ( "encoding/json" "fmt" "net/http" ) // Force overwriting of duplicate playlists. // By default, a playlist file uploaded with the same path will overwrite the existing playlist. // The `force` argument is used to disable overwriting. // If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. type Force int64 const ( ForceZero Force = 0 ForceOne Force = 1 ) func (e Force) ToPointer() *Force { return &e } func (e *Force) 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 = Force(v) return nil default: return fmt.Errorf("invalid value for Force: %v", v) } } type UploadPlaylistRequest struct { // absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. // If the `path` argument is a directory, that path will be scanned for playlist files to be processed. // Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. // The GUID of each playlist is based on the filename. // If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. // The GUID of each playlist is based on the filename. // Path string `queryParam:"style=form,explode=true,name=path"` // Force overwriting of duplicate playlists. // By default, a playlist file uploaded with the same path will overwrite the existing playlist. // The `force` argument is used to disable overwriting. // If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. // Force Force `queryParam:"style=form,explode=true,name=force"` } func (o *UploadPlaylistRequest) GetPath() string { if o == nil { return "" } return o.Path } func (o *UploadPlaylistRequest) GetForce() Force { if o == nil { return Force(0) } return o.Force } type UploadPlaylistErrors struct { Code *float64 `json:"code,omitempty"` Message *string `json:"message,omitempty"` Status *float64 `json:"status,omitempty"` } func (o *UploadPlaylistErrors) GetCode() *float64 { if o == nil { return nil } return o.Code } func (o *UploadPlaylistErrors) GetMessage() *string { if o == nil { return nil } return o.Message } func (o *UploadPlaylistErrors) GetStatus() *float64 { if o == nil { return nil } return o.Status } // UploadPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. type UploadPlaylistResponseBody struct { Errors []UploadPlaylistErrors `json:"errors,omitempty"` } func (o *UploadPlaylistResponseBody) GetErrors() []UploadPlaylistErrors { if o == nil { return nil } return o.Errors } type UploadPlaylistResponse 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 // Unauthorized - Returned if the X-Plex-Token is missing from the header or query. Object *UploadPlaylistResponseBody } func (o *UploadPlaylistResponse) GetContentType() string { if o == nil { return "" } return o.ContentType } func (o *UploadPlaylistResponse) GetStatusCode() int { if o == nil { return 0 } return o.StatusCode } func (o *UploadPlaylistResponse) GetRawResponse() *http.Response { if o == nil { return nil } return o.RawResponse } func (o *UploadPlaylistResponse) GetObject() *UploadPlaylistResponseBody { if o == nil { return nil } return o.Object }