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

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

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

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

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

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

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

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

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

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

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

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

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

type SetRatingRequest 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 identifier of the media provider containing the media to rate.  Typically `com.plexapp.plugins.library`
	Identifier string `queryParam:"style=form,explode=true,name=identifier"`
	// The key of the item to rate.  This is the `ratingKey` found in metadata items
	Key string `queryParam:"style=form,explode=true,name=key"`
	// The rating to give the item.
	Rating float64 `queryParam:"style=form,explode=true,name=rating"`
	// The time when the rating occurred.  If not present, interpreted as now.
	RatedAt *int64 `queryParam:"style=form,explode=true,name=ratedAt"`
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (s *SetRatingRequest) GetKey() string {
	if s == nil {
		return ""
	}
	return s.Key
}

func (s *SetRatingRequest) GetRating() float64 {
	if s == nil {
		return 0.0
	}
	return s.Rating
}

func (s *SetRatingRequest) GetRatedAt() *int64 {
	if s == nil {
		return nil
	}
	return s.RatedAt
}

type SetRatingResponse 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
}

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

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

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