// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package operations

import (
	"encoding/json"
	"fmt"
	"github.com/LukeHagar/plexgo/internal/utils"
	"github.com/LukeHagar/plexgo/models/components"
	"net/http"
)

type ListHubsGlobals struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
}

func (l ListHubsGlobals) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(l, "", false)
}

func (l *ListHubsGlobals) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (l *ListHubsGlobals) GetAccepts() *components.Accepts {
	if l == nil {
		return nil
	}
	return l.Accepts
}

func (l *ListHubsGlobals) GetClientIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.ClientIdentifier
}

func (l *ListHubsGlobals) GetProduct() *string {
	if l == nil {
		return nil
	}
	return l.Product
}

func (l *ListHubsGlobals) GetVersion() *string {
	if l == nil {
		return nil
	}
	return l.Version
}

func (l *ListHubsGlobals) GetPlatform() *string {
	if l == nil {
		return nil
	}
	return l.Platform
}

func (l *ListHubsGlobals) GetPlatformVersion() *string {
	if l == nil {
		return nil
	}
	return l.PlatformVersion
}

func (l *ListHubsGlobals) GetDevice() *string {
	if l == nil {
		return nil
	}
	return l.Device
}

func (l *ListHubsGlobals) GetModel() *string {
	if l == nil {
		return nil
	}
	return l.Model
}

func (l *ListHubsGlobals) GetDeviceVendor() *string {
	if l == nil {
		return nil
	}
	return l.DeviceVendor
}

func (l *ListHubsGlobals) GetDeviceName() *string {
	if l == nil {
		return nil
	}
	return l.DeviceName
}

func (l *ListHubsGlobals) GetMarketplace() *string {
	if l == nil {
		return nil
	}
	return l.Marketplace
}

type ListHubsRequest struct {
	// Indicates the client accepts the indicated media types
	Accepts *components.Accepts `default:"application/xml" header:"style=simple,explode=false,name=accepts"`
	// An opaque identifier unique to the client
	ClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
	// The name of the client product
	Product *string `header:"style=simple,explode=false,name=X-Plex-Product"`
	// The version of the client application
	Version *string `header:"style=simple,explode=false,name=X-Plex-Version"`
	// The platform of the client
	Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
	// The version of the platform
	PlatformVersion *string `header:"style=simple,explode=false,name=X-Plex-Platform-Version"`
	// A relatively friendly name for the client device
	Device *string `header:"style=simple,explode=false,name=X-Plex-Device"`
	// A potentially less friendly identifier for the device model
	Model *string `header:"style=simple,explode=false,name=X-Plex-Model"`
	// The device vendor
	DeviceVendor *string `header:"style=simple,explode=false,name=X-Plex-Device-Vendor"`
	// A friendly name for the client
	DeviceName *string `header:"style=simple,explode=false,name=X-Plex-Device-Name"`
	// The marketplace on which the client application is distributed
	Marketplace *string `header:"style=simple,explode=false,name=X-Plex-Marketplace"`
	// The section ID for the hubs to reorder
	SectionID int64 `pathParam:"style=simple,explode=false,name=sectionId"`
	// Restrict hubs to ones relevant to the provided metadata item
	MetadataItemID *int64 `queryParam:"style=form,explode=true,name=metadataItemId"`
}

func (l ListHubsRequest) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(l, "", false)
}

func (l *ListHubsRequest) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &l, "", false, []string{"sectionId"}); err != nil {
		return err
	}
	return nil
}

func (l *ListHubsRequest) GetAccepts() *components.Accepts {
	if l == nil {
		return nil
	}
	return l.Accepts
}

func (l *ListHubsRequest) GetClientIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.ClientIdentifier
}

func (l *ListHubsRequest) GetProduct() *string {
	if l == nil {
		return nil
	}
	return l.Product
}

func (l *ListHubsRequest) GetVersion() *string {
	if l == nil {
		return nil
	}
	return l.Version
}

func (l *ListHubsRequest) GetPlatform() *string {
	if l == nil {
		return nil
	}
	return l.Platform
}

func (l *ListHubsRequest) GetPlatformVersion() *string {
	if l == nil {
		return nil
	}
	return l.PlatformVersion
}

func (l *ListHubsRequest) GetDevice() *string {
	if l == nil {
		return nil
	}
	return l.Device
}

func (l *ListHubsRequest) GetModel() *string {
	if l == nil {
		return nil
	}
	return l.Model
}

func (l *ListHubsRequest) GetDeviceVendor() *string {
	if l == nil {
		return nil
	}
	return l.DeviceVendor
}

func (l *ListHubsRequest) GetDeviceName() *string {
	if l == nil {
		return nil
	}
	return l.DeviceName
}

func (l *ListHubsRequest) GetMarketplace() *string {
	if l == nil {
		return nil
	}
	return l.Marketplace
}

func (l *ListHubsRequest) GetSectionID() int64 {
	if l == nil {
		return 0
	}
	return l.SectionID
}

func (l *ListHubsRequest) GetMetadataItemID() *int64 {
	if l == nil {
		return nil
	}
	return l.MetadataItemID
}

// HomeVisibility - Whether this hub is visible on the home screen
//   - all: Visible to all users
//   - none: Visible to no users
//   - admin: Visible to only admin users
//   - shared: Visible to shared users
type HomeVisibility string

const (
	HomeVisibilityAll    HomeVisibility = "all"
	HomeVisibilityNone   HomeVisibility = "none"
	HomeVisibilityAdmin  HomeVisibility = "admin"
	HomeVisibilityShared HomeVisibility = "shared"
)

func (e HomeVisibility) ToPointer() *HomeVisibility {
	return &e
}
func (e *HomeVisibility) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "all":
		fallthrough
	case "none":
		fallthrough
	case "admin":
		fallthrough
	case "shared":
		*e = HomeVisibility(v)
		return nil
	default:
		return fmt.Errorf("invalid value for HomeVisibility: %v", v)
	}
}

// RecommendationsVisibility - The visibility of this hub in recommendations:
//   - all: Visible to all users
//   - none: Visible to no users
//   - admin: Visible to only admin users
//   - shared: Visible to shared users
type RecommendationsVisibility string

const (
	RecommendationsVisibilityAll    RecommendationsVisibility = "all"
	RecommendationsVisibilityNone   RecommendationsVisibility = "none"
	RecommendationsVisibilityAdmin  RecommendationsVisibility = "admin"
	RecommendationsVisibilityShared RecommendationsVisibility = "shared"
)

func (e RecommendationsVisibility) ToPointer() *RecommendationsVisibility {
	return &e
}
func (e *RecommendationsVisibility) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "all":
		fallthrough
	case "none":
		fallthrough
	case "admin":
		fallthrough
	case "shared":
		*e = RecommendationsVisibility(v)
		return nil
	default:
		return fmt.Errorf("invalid value for RecommendationsVisibility: %v", v)
	}
}

type Hub struct {
	// Whether this hub is visible on the home screen
	//   - all: Visible to all users
	//   - none: Visible to no users
	//   - admin: Visible to only admin users
	//   - shared: Visible to shared users
	//
	HomeVisibility *HomeVisibility `json:"homeVisibility,omitempty"`
	// The identifier for this hub
	Identifier *string `json:"identifier,omitempty"`
	// Whether this hub is visible to admin user home
	PromotedToOwnHome *bool `json:"promotedToOwnHome,omitempty"`
	// Whether this hub is promoted to all for recommendations
	PromotedToRecommended *bool `json:"promotedToRecommended,omitempty"`
	// Whether this hub is visible to shared user's home
	PromotedToSharedHome *bool `json:"promotedToSharedHome,omitempty"`
	// The visibility of this hub in recommendations:
	//   - all: Visible to all users
	//   - none: Visible to no users
	//   - admin: Visible to only admin users
	//   - shared: Visible to shared users
	//
	RecommendationsVisibility *RecommendationsVisibility `json:"recommendationsVisibility,omitempty"`
	// The title of this hub
	Title *string `json:"title,omitempty"`
}

func (h *Hub) GetHomeVisibility() *HomeVisibility {
	if h == nil {
		return nil
	}
	return h.HomeVisibility
}

func (h *Hub) GetIdentifier() *string {
	if h == nil {
		return nil
	}
	return h.Identifier
}

func (h *Hub) GetPromotedToOwnHome() *bool {
	if h == nil {
		return nil
	}
	return h.PromotedToOwnHome
}

func (h *Hub) GetPromotedToRecommended() *bool {
	if h == nil {
		return nil
	}
	return h.PromotedToRecommended
}

func (h *Hub) GetPromotedToSharedHome() *bool {
	if h == nil {
		return nil
	}
	return h.PromotedToSharedHome
}

func (h *Hub) GetRecommendationsVisibility() *RecommendationsVisibility {
	if h == nil {
		return nil
	}
	return h.RecommendationsVisibility
}

func (h *Hub) GetTitle() *string {
	if h == nil {
		return nil
	}
	return h.Title
}

// ListHubsMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.
type ListHubsMediaContainer struct {
	Identifier *string `json:"identifier,omitempty"`
	// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
	//
	Offset *int64 `json:"offset,omitempty"`
	Size   *int64 `json:"size,omitempty"`
	// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
	//
	TotalSize *int64 `json:"totalSize,omitempty"`
	Hub       []Hub  `json:"Hub,omitempty"`
}

func (l *ListHubsMediaContainer) GetIdentifier() *string {
	if l == nil {
		return nil
	}
	return l.Identifier
}

func (l *ListHubsMediaContainer) GetOffset() *int64 {
	if l == nil {
		return nil
	}
	return l.Offset
}

func (l *ListHubsMediaContainer) GetSize() *int64 {
	if l == nil {
		return nil
	}
	return l.Size
}

func (l *ListHubsMediaContainer) GetTotalSize() *int64 {
	if l == nil {
		return nil
	}
	return l.TotalSize
}

func (l *ListHubsMediaContainer) GetHub() []Hub {
	if l == nil {
		return nil
	}
	return l.Hub
}

// ListHubsResponseBody - OK
type ListHubsResponseBody struct {
	MediaContainer *ListHubsMediaContainer `json:"MediaContainer,omitempty"`
}

func (l *ListHubsResponseBody) GetMediaContainer() *ListHubsMediaContainer {
	if l == nil {
		return nil
	}
	return l.MediaContainer
}

type ListHubsResponse 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
	// OK
	Object  *ListHubsResponseBody
	Headers map[string][]string
}

func (l *ListHubsResponse) GetContentType() string {
	if l == nil {
		return ""
	}
	return l.ContentType
}

func (l *ListHubsResponse) GetStatusCode() int {
	if l == nil {
		return 0
	}
	return l.StatusCode
}

func (l *ListHubsResponse) GetRawResponse() *http.Response {
	if l == nil {
		return nil
	}
	return l.RawResponse
}

func (l *ListHubsResponse) GetObject() *ListHubsResponseBody {
	if l == nil {
		return nil
	}
	return l.Object
}

func (l *ListHubsResponse) GetHeaders() map[string][]string {
	if l == nil {
		return map[string][]string{}
	}
	return l.Headers
}
