Files
plexgo/models/operations/getcountrieslibrary.go

287 lines
6.8 KiB
Go

// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"net/http"
)
// GetCountriesLibraryQueryParamType - The type of media to retrieve or filter by.
// 1 = movie
// 2 = show
// 3 = season
// 4 = episode
// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
type GetCountriesLibraryQueryParamType int64
const (
GetCountriesLibraryQueryParamTypeMovie GetCountriesLibraryQueryParamType = 1
GetCountriesLibraryQueryParamTypeTvShow GetCountriesLibraryQueryParamType = 2
GetCountriesLibraryQueryParamTypeSeason GetCountriesLibraryQueryParamType = 3
GetCountriesLibraryQueryParamTypeEpisode GetCountriesLibraryQueryParamType = 4
GetCountriesLibraryQueryParamTypeAudio GetCountriesLibraryQueryParamType = 8
GetCountriesLibraryQueryParamTypeAlbum GetCountriesLibraryQueryParamType = 9
GetCountriesLibraryQueryParamTypeTrack GetCountriesLibraryQueryParamType = 10
)
func (e GetCountriesLibraryQueryParamType) ToPointer() *GetCountriesLibraryQueryParamType {
return &e
}
func (e *GetCountriesLibraryQueryParamType) UnmarshalJSON(data []byte) error {
var v int64
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 1:
fallthrough
case 2:
fallthrough
case 3:
fallthrough
case 4:
fallthrough
case 8:
fallthrough
case 9:
fallthrough
case 10:
*e = GetCountriesLibraryQueryParamType(v)
return nil
default:
return fmt.Errorf("invalid value for GetCountriesLibraryQueryParamType: %v", v)
}
}
type GetCountriesLibraryRequest struct {
// The unique key of the Plex library.
// Note: This is unique in the context of the Plex server.
//
SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"`
// The type of media to retrieve or filter by.
// 1 = movie
// 2 = show
// 3 = season
// 4 = episode
// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
//
Type GetCountriesLibraryQueryParamType `queryParam:"style=form,explode=true,name=type"`
}
func (o *GetCountriesLibraryRequest) GetSectionKey() int {
if o == nil {
return 0
}
return o.SectionKey
}
func (o *GetCountriesLibraryRequest) GetType() GetCountriesLibraryQueryParamType {
if o == nil {
return GetCountriesLibraryQueryParamType(0)
}
return o.Type
}
type GetCountriesLibraryDirectory struct {
FastKey string `json:"fastKey"`
Key string `json:"key"`
Title string `json:"title"`
}
func (o *GetCountriesLibraryDirectory) GetFastKey() string {
if o == nil {
return ""
}
return o.FastKey
}
func (o *GetCountriesLibraryDirectory) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetCountriesLibraryDirectory) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
type GetCountriesLibraryMediaContainer struct {
Size float64 `json:"size"`
Offset *int `json:"offset,omitempty"`
TotalSize *int `json:"totalSize,omitempty"`
Identifier string `json:"identifier"`
AllowSync bool `json:"allowSync"`
Art string `json:"art"`
Content string `json:"content"`
MediaTagPrefix string `json:"mediaTagPrefix"`
MediaTagVersion int64 `json:"mediaTagVersion"`
Nocache bool `json:"nocache"`
Thumb string `json:"thumb"`
Title1 string `json:"title1"`
Title2 string `json:"title2"`
ViewGroup string `json:"viewGroup"`
Directory []GetCountriesLibraryDirectory `json:"Directory,omitempty"`
}
func (o *GetCountriesLibraryMediaContainer) GetSize() float64 {
if o == nil {
return 0.0
}
return o.Size
}
func (o *GetCountriesLibraryMediaContainer) GetOffset() *int {
if o == nil {
return nil
}
return o.Offset
}
func (o *GetCountriesLibraryMediaContainer) GetTotalSize() *int {
if o == nil {
return nil
}
return o.TotalSize
}
func (o *GetCountriesLibraryMediaContainer) GetIdentifier() string {
if o == nil {
return ""
}
return o.Identifier
}
func (o *GetCountriesLibraryMediaContainer) GetAllowSync() bool {
if o == nil {
return false
}
return o.AllowSync
}
func (o *GetCountriesLibraryMediaContainer) GetArt() string {
if o == nil {
return ""
}
return o.Art
}
func (o *GetCountriesLibraryMediaContainer) GetContent() string {
if o == nil {
return ""
}
return o.Content
}
func (o *GetCountriesLibraryMediaContainer) GetMediaTagPrefix() string {
if o == nil {
return ""
}
return o.MediaTagPrefix
}
func (o *GetCountriesLibraryMediaContainer) GetMediaTagVersion() int64 {
if o == nil {
return 0
}
return o.MediaTagVersion
}
func (o *GetCountriesLibraryMediaContainer) GetNocache() bool {
if o == nil {
return false
}
return o.Nocache
}
func (o *GetCountriesLibraryMediaContainer) GetThumb() string {
if o == nil {
return ""
}
return o.Thumb
}
func (o *GetCountriesLibraryMediaContainer) GetTitle1() string {
if o == nil {
return ""
}
return o.Title1
}
func (o *GetCountriesLibraryMediaContainer) GetTitle2() string {
if o == nil {
return ""
}
return o.Title2
}
func (o *GetCountriesLibraryMediaContainer) GetViewGroup() string {
if o == nil {
return ""
}
return o.ViewGroup
}
func (o *GetCountriesLibraryMediaContainer) GetDirectory() []GetCountriesLibraryDirectory {
if o == nil {
return nil
}
return o.Directory
}
// GetCountriesLibraryResponseBody - Successful response containing media container data.
type GetCountriesLibraryResponseBody struct {
MediaContainer *GetCountriesLibraryMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetCountriesLibraryResponseBody) GetMediaContainer() *GetCountriesLibraryMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetCountriesLibraryResponse 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
// Successful response containing media container data.
Object *GetCountriesLibraryResponseBody
}
func (o *GetCountriesLibraryResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetCountriesLibraryResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetCountriesLibraryResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetCountriesLibraryResponse) GetObject() *GetCountriesLibraryResponseBody {
if o == nil {
return nil
}
return o.Object
}