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

package operations

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

type SearchHubsGlobals 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 (s SearchHubsGlobals) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

func (s *SearchHubsGlobals) GetAccepts() *components.Accepts {
	if s == nil {
		return nil
	}
	return s.Accepts
}

func (s *SearchHubsGlobals) GetClientIdentifier() *string {
	if s == nil {
		return nil
	}
	return s.ClientIdentifier
}

func (s *SearchHubsGlobals) GetProduct() *string {
	if s == nil {
		return nil
	}
	return s.Product
}

func (s *SearchHubsGlobals) GetVersion() *string {
	if s == nil {
		return nil
	}
	return s.Version
}

func (s *SearchHubsGlobals) GetPlatform() *string {
	if s == nil {
		return nil
	}
	return s.Platform
}

func (s *SearchHubsGlobals) GetPlatformVersion() *string {
	if s == nil {
		return nil
	}
	return s.PlatformVersion
}

func (s *SearchHubsGlobals) GetDevice() *string {
	if s == nil {
		return nil
	}
	return s.Device
}

func (s *SearchHubsGlobals) GetModel() *string {
	if s == nil {
		return nil
	}
	return s.Model
}

func (s *SearchHubsGlobals) GetDeviceVendor() *string {
	if s == nil {
		return nil
	}
	return s.DeviceVendor
}

func (s *SearchHubsGlobals) GetDeviceName() *string {
	if s == nil {
		return nil
	}
	return s.DeviceName
}

func (s *SearchHubsGlobals) GetMarketplace() *string {
	if s == nil {
		return nil
	}
	return s.Marketplace
}

type SearchHubsRequest 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 query term
	Query string `queryParam:"style=form,explode=true,name=query"`
	// This gives context to the search, and can result in re-ordering of search result hubs.
	SectionID *int64 `queryParam:"style=form,explode=true,name=sectionId"`
	// The number of items to return per hub.  3 if not specified
	Limit *int64 `queryParam:"style=form,explode=true,name=limit"`
}

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

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

func (s *SearchHubsRequest) GetAccepts() *components.Accepts {
	if s == nil {
		return nil
	}
	return s.Accepts
}

func (s *SearchHubsRequest) GetClientIdentifier() *string {
	if s == nil {
		return nil
	}
	return s.ClientIdentifier
}

func (s *SearchHubsRequest) GetProduct() *string {
	if s == nil {
		return nil
	}
	return s.Product
}

func (s *SearchHubsRequest) GetVersion() *string {
	if s == nil {
		return nil
	}
	return s.Version
}

func (s *SearchHubsRequest) GetPlatform() *string {
	if s == nil {
		return nil
	}
	return s.Platform
}

func (s *SearchHubsRequest) GetPlatformVersion() *string {
	if s == nil {
		return nil
	}
	return s.PlatformVersion
}

func (s *SearchHubsRequest) GetDevice() *string {
	if s == nil {
		return nil
	}
	return s.Device
}

func (s *SearchHubsRequest) GetModel() *string {
	if s == nil {
		return nil
	}
	return s.Model
}

func (s *SearchHubsRequest) GetDeviceVendor() *string {
	if s == nil {
		return nil
	}
	return s.DeviceVendor
}

func (s *SearchHubsRequest) GetDeviceName() *string {
	if s == nil {
		return nil
	}
	return s.DeviceName
}

func (s *SearchHubsRequest) GetMarketplace() *string {
	if s == nil {
		return nil
	}
	return s.Marketplace
}

func (s *SearchHubsRequest) GetQuery() string {
	if s == nil {
		return ""
	}
	return s.Query
}

func (s *SearchHubsRequest) GetSectionID() *int64 {
	if s == nil {
		return nil
	}
	return s.SectionID
}

func (s *SearchHubsRequest) GetLimit() *int64 {
	if s == nil {
		return nil
	}
	return s.Limit
}

// SearchHubsMediaContainer - `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 SearchHubsMediaContainer 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       []components.Hub `json:"Hub,omitempty"`
}

func (s *SearchHubsMediaContainer) GetIdentifier() *string {
	if s == nil {
		return nil
	}
	return s.Identifier
}

func (s *SearchHubsMediaContainer) GetOffset() *int64 {
	if s == nil {
		return nil
	}
	return s.Offset
}

func (s *SearchHubsMediaContainer) GetSize() *int64 {
	if s == nil {
		return nil
	}
	return s.Size
}

func (s *SearchHubsMediaContainer) GetTotalSize() *int64 {
	if s == nil {
		return nil
	}
	return s.TotalSize
}

func (s *SearchHubsMediaContainer) GetHub() []components.Hub {
	if s == nil {
		return nil
	}
	return s.Hub
}

// SearchHubsResponseBody - OK
type SearchHubsResponseBody struct {
	MediaContainer *SearchHubsMediaContainer `json:"MediaContainer,omitempty"`
}

func (s *SearchHubsResponseBody) GetMediaContainer() *SearchHubsMediaContainer {
	if s == nil {
		return nil
	}
	return s.MediaContainer
}

type SearchHubsResponse 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  *SearchHubsResponseBody
	Headers map[string][]string
}

func (s *SearchHubsResponse) GetContentType() string {
	if s == nil {
		return ""
	}
	return s.ContentType
}

func (s *SearchHubsResponse) GetStatusCode() int {
	if s == nil {
		return 0
	}
	return s.StatusCode
}

func (s *SearchHubsResponse) GetRawResponse() *http.Response {
	if s == nil {
		return nil
	}
	return s.RawResponse
}

func (s *SearchHubsResponse) GetObject() *SearchHubsResponseBody {
	if s == nil {
		return nil
	}
	return s.Object
}

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