ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.314.2

This commit is contained in:
speakeasybot
2024-06-22 00:19:59 +00:00
parent acc9cf3c62
commit e0b73fab9a
25 changed files with 1565 additions and 58 deletions

View File

@@ -0,0 +1,316 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"net/http"
)
type GetBandwidthStatisticsRequest struct {
// The timespan to retrieve statistics for
// the exact meaning of this parameter is not known
//
Timespan *int64 `queryParam:"style=form,explode=true,name=Timespan"`
}
func (o *GetBandwidthStatisticsRequest) GetTimespan() *int64 {
if o == nil {
return nil
}
return o.Timespan
}
type GetBandwidthStatisticsErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Status *float64 `json:"status,omitempty"`
}
func (o *GetBandwidthStatisticsErrors) GetCode() *float64 {
if o == nil {
return nil
}
return o.Code
}
func (o *GetBandwidthStatisticsErrors) GetMessage() *string {
if o == nil {
return nil
}
return o.Message
}
func (o *GetBandwidthStatisticsErrors) GetStatus() *float64 {
if o == nil {
return nil
}
return o.Status
}
// GetBandwidthStatisticsStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
type GetBandwidthStatisticsStatisticsResponseBody struct {
Errors []GetBandwidthStatisticsErrors `json:"errors,omitempty"`
}
func (o *GetBandwidthStatisticsStatisticsResponseBody) GetErrors() []GetBandwidthStatisticsErrors {
if o == nil {
return nil
}
return o.Errors
}
type GetBandwidthStatisticsDevice struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Platform *string `json:"platform,omitempty"`
ClientIdentifier *string `json:"clientIdentifier,omitempty"`
CreatedAt *int `json:"createdAt,omitempty"`
}
func (o *GetBandwidthStatisticsDevice) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetBandwidthStatisticsDevice) GetName() *string {
if o == nil {
return nil
}
return o.Name
}
func (o *GetBandwidthStatisticsDevice) GetPlatform() *string {
if o == nil {
return nil
}
return o.Platform
}
func (o *GetBandwidthStatisticsDevice) GetClientIdentifier() *string {
if o == nil {
return nil
}
return o.ClientIdentifier
}
func (o *GetBandwidthStatisticsDevice) GetCreatedAt() *int {
if o == nil {
return nil
}
return o.CreatedAt
}
type GetBandwidthStatisticsAccount struct {
ID *int `json:"id,omitempty"`
Key *string `json:"key,omitempty"`
Name *string `json:"name,omitempty"`
DefaultAudioLanguage *string `json:"defaultAudioLanguage,omitempty"`
AutoSelectAudio *bool `json:"autoSelectAudio,omitempty"`
DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage,omitempty"`
SubtitleMode *int `json:"subtitleMode,omitempty"`
Thumb *string `json:"thumb,omitempty"`
}
func (o *GetBandwidthStatisticsAccount) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetBandwidthStatisticsAccount) GetKey() *string {
if o == nil {
return nil
}
return o.Key
}
func (o *GetBandwidthStatisticsAccount) GetName() *string {
if o == nil {
return nil
}
return o.Name
}
func (o *GetBandwidthStatisticsAccount) GetDefaultAudioLanguage() *string {
if o == nil {
return nil
}
return o.DefaultAudioLanguage
}
func (o *GetBandwidthStatisticsAccount) GetAutoSelectAudio() *bool {
if o == nil {
return nil
}
return o.AutoSelectAudio
}
func (o *GetBandwidthStatisticsAccount) GetDefaultSubtitleLanguage() *string {
if o == nil {
return nil
}
return o.DefaultSubtitleLanguage
}
func (o *GetBandwidthStatisticsAccount) GetSubtitleMode() *int {
if o == nil {
return nil
}
return o.SubtitleMode
}
func (o *GetBandwidthStatisticsAccount) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
type StatisticsBandwidth struct {
AccountID *int `json:"accountID,omitempty"`
DeviceID *int `json:"deviceID,omitempty"`
Timespan *int64 `json:"timespan,omitempty"`
At *int `json:"at,omitempty"`
Lan *bool `json:"lan,omitempty"`
Bytes *int64 `json:"bytes,omitempty"`
}
func (o *StatisticsBandwidth) GetAccountID() *int {
if o == nil {
return nil
}
return o.AccountID
}
func (o *StatisticsBandwidth) GetDeviceID() *int {
if o == nil {
return nil
}
return o.DeviceID
}
func (o *StatisticsBandwidth) GetTimespan() *int64 {
if o == nil {
return nil
}
return o.Timespan
}
func (o *StatisticsBandwidth) GetAt() *int {
if o == nil {
return nil
}
return o.At
}
func (o *StatisticsBandwidth) GetLan() *bool {
if o == nil {
return nil
}
return o.Lan
}
func (o *StatisticsBandwidth) GetBytes() *int64 {
if o == nil {
return nil
}
return o.Bytes
}
type GetBandwidthStatisticsMediaContainer struct {
Size *int `json:"size,omitempty"`
Device []GetBandwidthStatisticsDevice `json:"Device,omitempty"`
Account []GetBandwidthStatisticsAccount `json:"Account,omitempty"`
StatisticsBandwidth []StatisticsBandwidth `json:"StatisticsBandwidth,omitempty"`
}
func (o *GetBandwidthStatisticsMediaContainer) GetSize() *int {
if o == nil {
return nil
}
return o.Size
}
func (o *GetBandwidthStatisticsMediaContainer) GetDevice() []GetBandwidthStatisticsDevice {
if o == nil {
return nil
}
return o.Device
}
func (o *GetBandwidthStatisticsMediaContainer) GetAccount() []GetBandwidthStatisticsAccount {
if o == nil {
return nil
}
return o.Account
}
func (o *GetBandwidthStatisticsMediaContainer) GetStatisticsBandwidth() []StatisticsBandwidth {
if o == nil {
return nil
}
return o.StatisticsBandwidth
}
// GetBandwidthStatisticsResponseBody - Bandwidth Statistics
type GetBandwidthStatisticsResponseBody struct {
MediaContainer *GetBandwidthStatisticsMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetBandwidthStatisticsResponseBody) GetMediaContainer() *GetBandwidthStatisticsMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetBandwidthStatisticsResponse 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
// Bandwidth Statistics
TwoHundredApplicationJSONObject *GetBandwidthStatisticsResponseBody
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
FourHundredAndOneApplicationJSONObject *GetBandwidthStatisticsStatisticsResponseBody
}
func (o *GetBandwidthStatisticsResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetBandwidthStatisticsResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetBandwidthStatisticsResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetBandwidthStatisticsResponse) GetTwoHundredApplicationJSONObject() *GetBandwidthStatisticsResponseBody {
if o == nil {
return nil
}
return o.TwoHundredApplicationJSONObject
}
func (o *GetBandwidthStatisticsResponse) GetFourHundredAndOneApplicationJSONObject() *GetBandwidthStatisticsStatisticsResponseBody {
if o == nil {
return nil
}
return o.FourHundredAndOneApplicationJSONObject
}

View File

@@ -4,6 +4,7 @@ package operations
import (
"encoding/json"
"errors"
"fmt"
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/internal/utils"
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/types"
@@ -93,6 +94,9 @@ type GetLibraryItemsRequest struct {
SectionID any `pathParam:"style=simple,explode=false,name=sectionId"`
// A key representing a specific tag within the section.
Tag Tag `pathParam:"style=simple,explode=false,name=tag"`
// Adds the Guids object to the response
//
IncludeGuids *int64 `queryParam:"style=form,explode=true,name=includeGuids"`
}
func (o *GetLibraryItemsRequest) GetSectionID() any {
@@ -109,6 +113,13 @@ func (o *GetLibraryItemsRequest) GetTag() Tag {
return o.Tag
}
func (o *GetLibraryItemsRequest) GetIncludeGuids() *int64 {
if o == nil {
return nil
}
return o.IncludeGuids
}
type GetLibraryItemsErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
@@ -148,6 +159,69 @@ func (o *GetLibraryItemsLibraryResponseBody) GetErrors() []GetLibraryItemsErrors
return o.Errors
}
type LibrarySectionIDType string
const (
LibrarySectionIDTypeInteger LibrarySectionIDType = "integer"
LibrarySectionIDTypeStr LibrarySectionIDType = "str"
)
type LibrarySectionID struct {
Integer *int64
Str *string
Type LibrarySectionIDType
}
func CreateLibrarySectionIDInteger(integer int64) LibrarySectionID {
typ := LibrarySectionIDTypeInteger
return LibrarySectionID{
Integer: &integer,
Type: typ,
}
}
func CreateLibrarySectionIDStr(str string) LibrarySectionID {
typ := LibrarySectionIDTypeStr
return LibrarySectionID{
Str: &str,
Type: typ,
}
}
func (u *LibrarySectionID) UnmarshalJSON(data []byte) error {
var integer int64 = int64(0)
if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil {
u.Integer = &integer
u.Type = LibrarySectionIDTypeInteger
return nil
}
var str string = ""
if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil {
u.Str = &str
u.Type = LibrarySectionIDTypeStr
return nil
}
return fmt.Errorf("could not unmarshal `%s` into any supported union types for LibrarySectionID", string(data))
}
func (u LibrarySectionID) MarshalJSON() ([]byte, error) {
if u.Integer != nil {
return utils.MarshalJSON(u.Integer, "", true)
}
if u.Str != nil {
return utils.MarshalJSON(u.Str, "", true)
}
return nil, errors.New("could not marshal union type LibrarySectionID: all fields are null")
}
type GetLibraryItemsPart struct {
ID *int `json:"id,omitempty"`
Key *string `json:"key,omitempty"`
@@ -852,7 +926,7 @@ type GetLibraryItemsMediaContainer struct {
AllowSync *bool `json:"allowSync,omitempty"`
Art *string `json:"art,omitempty"`
Identifier *string `json:"identifier,omitempty"`
LibrarySectionID *int `json:"librarySectionID,omitempty"`
LibrarySectionID *LibrarySectionID `json:"librarySectionID,omitempty"`
LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"`
LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"`
MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"`
@@ -894,7 +968,7 @@ func (o *GetLibraryItemsMediaContainer) GetIdentifier() *string {
return o.Identifier
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionID() *int {
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionID() *LibrarySectionID {
if o == nil {
return nil
}

View File

@@ -9,6 +9,9 @@ import (
type GetMetadataChildrenRequest struct {
// the id of the library item to return the children of.
RatingKey float64 `pathParam:"style=simple,explode=false,name=ratingKey"`
// Adds additional elements to the response. Supported types are (Stream)
//
IncludeElements *string `queryParam:"style=form,explode=true,name=includeElements"`
}
func (o *GetMetadataChildrenRequest) GetRatingKey() float64 {
@@ -18,6 +21,13 @@ func (o *GetMetadataChildrenRequest) GetRatingKey() float64 {
return o.RatingKey
}
func (o *GetMetadataChildrenRequest) GetIncludeElements() *string {
if o == nil {
return nil
}
return o.IncludeElements
}
type GetMetadataChildrenErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`

View File

@@ -17,12 +17,12 @@ type GetPinGlobals struct {
// This is used to track the client application and its usage
// (UUID, serial number, or other number unique per device)
//
XPlexClientIdentifier string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
}
func (o *GetPinGlobals) GetXPlexClientIdentifier() string {
func (o *GetPinGlobals) GetXPlexClientIdentifier() *string {
if o == nil {
return ""
return nil
}
return o.XPlexClientIdentifier
}
@@ -215,7 +215,7 @@ type GetPinResponseBody struct {
CreatedAt *time.Time `json:"createdAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
AuthToken *string `json:"authToken,omitempty"`
NewRegistration *string `json:"newRegistration,omitempty"`
NewRegistration *bool `json:"newRegistration,omitempty"`
}
func (g GetPinResponseBody) MarshalJSON() ([]byte, error) {
@@ -306,7 +306,7 @@ func (o *GetPinResponseBody) GetAuthToken() *string {
return o.AuthToken
}
func (o *GetPinResponseBody) GetNewRegistration() *string {
func (o *GetPinResponseBody) GetNewRegistration() *bool {
if o == nil {
return nil
}

View File

@@ -0,0 +1,190 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"net/http"
)
type GetResourcesStatisticsRequest struct {
// The timespan to retrieve statistics for
// the exact meaning of this parameter is not known
//
Timespan *int64 `queryParam:"style=form,explode=true,name=Timespan"`
}
func (o *GetResourcesStatisticsRequest) GetTimespan() *int64 {
if o == nil {
return nil
}
return o.Timespan
}
type GetResourcesStatisticsErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Status *float64 `json:"status,omitempty"`
}
func (o *GetResourcesStatisticsErrors) GetCode() *float64 {
if o == nil {
return nil
}
return o.Code
}
func (o *GetResourcesStatisticsErrors) GetMessage() *string {
if o == nil {
return nil
}
return o.Message
}
func (o *GetResourcesStatisticsErrors) GetStatus() *float64 {
if o == nil {
return nil
}
return o.Status
}
// GetResourcesStatisticsStatisticsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
type GetResourcesStatisticsStatisticsResponseBody struct {
Errors []GetResourcesStatisticsErrors `json:"errors,omitempty"`
}
func (o *GetResourcesStatisticsStatisticsResponseBody) GetErrors() []GetResourcesStatisticsErrors {
if o == nil {
return nil
}
return o.Errors
}
type StatisticsResources struct {
Timespan *int64 `json:"timespan,omitempty"`
At *int64 `json:"at,omitempty"`
HostCPUUtilization *float32 `json:"hostCpuUtilization,omitempty"`
ProcessCPUUtilization *float32 `json:"processCpuUtilization,omitempty"`
HostMemoryUtilization *float32 `json:"hostMemoryUtilization,omitempty"`
ProcessMemoryUtilization *float32 `json:"processMemoryUtilization,omitempty"`
}
func (o *StatisticsResources) GetTimespan() *int64 {
if o == nil {
return nil
}
return o.Timespan
}
func (o *StatisticsResources) GetAt() *int64 {
if o == nil {
return nil
}
return o.At
}
func (o *StatisticsResources) GetHostCPUUtilization() *float32 {
if o == nil {
return nil
}
return o.HostCPUUtilization
}
func (o *StatisticsResources) GetProcessCPUUtilization() *float32 {
if o == nil {
return nil
}
return o.ProcessCPUUtilization
}
func (o *StatisticsResources) GetHostMemoryUtilization() *float32 {
if o == nil {
return nil
}
return o.HostMemoryUtilization
}
func (o *StatisticsResources) GetProcessMemoryUtilization() *float32 {
if o == nil {
return nil
}
return o.ProcessMemoryUtilization
}
type GetResourcesStatisticsMediaContainer struct {
Size *int `json:"size,omitempty"`
StatisticsResources []StatisticsResources `json:"StatisticsResources,omitempty"`
}
func (o *GetResourcesStatisticsMediaContainer) GetSize() *int {
if o == nil {
return nil
}
return o.Size
}
func (o *GetResourcesStatisticsMediaContainer) GetStatisticsResources() []StatisticsResources {
if o == nil {
return nil
}
return o.StatisticsResources
}
// GetResourcesStatisticsResponseBody - Resource Statistics
type GetResourcesStatisticsResponseBody struct {
MediaContainer *GetResourcesStatisticsMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetResourcesStatisticsResponseBody) GetMediaContainer() *GetResourcesStatisticsMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetResourcesStatisticsResponse 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
// Resource Statistics
TwoHundredApplicationJSONObject *GetResourcesStatisticsResponseBody
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
FourHundredAndOneApplicationJSONObject *GetResourcesStatisticsStatisticsResponseBody
}
func (o *GetResourcesStatisticsResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetResourcesStatisticsResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetResourcesStatisticsResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetResourcesStatisticsResponse) GetTwoHundredApplicationJSONObject() *GetResourcesStatisticsResponseBody {
if o == nil {
return nil
}
return o.TwoHundredApplicationJSONObject
}
func (o *GetResourcesStatisticsResponse) GetFourHundredAndOneApplicationJSONObject() *GetResourcesStatisticsStatisticsResponseBody {
if o == nil {
return nil
}
return o.FourHundredAndOneApplicationJSONObject
}

View File

@@ -8,6 +8,55 @@ import (
"net/http"
)
// Filter - Filters content by field and direction/equality
// (Unknown if viewedAt is the only supported column)
type Filter struct {
}
type GetSessionHistoryRequest struct {
// Sorts the results by the specified field followed by the direction (asc, desc)
//
Sort *string `queryParam:"style=form,explode=true,name=sort"`
// Filter results by those that are related to a specific users id
//
AccountID *int64 `queryParam:"style=form,explode=true,name=accountId"`
// Filters content by field and direction/equality
// (Unknown if viewedAt is the only supported column)
//
Filter *Filter `queryParam:"style=form,explode=true,name=filter"`
// Filters the results based on the id of a valid library section
//
LibrarySectionID *int64 `queryParam:"style=form,explode=true,name=librarySectionID"`
}
func (o *GetSessionHistoryRequest) GetSort() *string {
if o == nil {
return nil
}
return o.Sort
}
func (o *GetSessionHistoryRequest) GetAccountID() *int64 {
if o == nil {
return nil
}
return o.AccountID
}
func (o *GetSessionHistoryRequest) GetFilter() *Filter {
if o == nil {
return nil
}
return o.Filter
}
func (o *GetSessionHistoryRequest) GetLibrarySectionID() *int64 {
if o == nil {
return nil
}
return o.LibrarySectionID
}
type GetSessionHistoryErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`

View File

@@ -358,27 +358,27 @@ func (o *GetSessionsMedia) GetPart() []GetSessionsPart {
return o.Part
}
type User struct {
type GetSessionsUser struct {
ID *string `json:"id,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Title *string `json:"title,omitempty"`
}
func (o *User) GetID() *string {
func (o *GetSessionsUser) GetID() *string {
if o == nil {
return nil
}
return o.ID
}
func (o *User) GetThumb() *string {
func (o *GetSessionsUser) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *User) GetTitle() *string {
func (o *GetSessionsUser) GetTitle() *string {
if o == nil {
return nil
}
@@ -570,7 +570,7 @@ type GetSessionsMetadata struct {
UpdatedAt *int `json:"updatedAt,omitempty"`
ViewOffset *int `json:"viewOffset,omitempty"`
Media []GetSessionsMedia `json:"Media,omitempty"`
User *User `json:"User,omitempty"`
User *GetSessionsUser `json:"User,omitempty"`
Player *Player `json:"Player,omitempty"`
Session *Session `json:"Session,omitempty"`
}
@@ -813,7 +813,7 @@ func (o *GetSessionsMetadata) GetMedia() []GetSessionsMedia {
return o.Media
}
func (o *GetSessionsMetadata) GetUser() *User {
func (o *GetSessionsMetadata) GetUser() *GetSessionsUser {
if o == nil {
return nil
}

View File

@@ -17,12 +17,12 @@ type GetTokenGlobals struct {
// This is used to track the client application and its usage
// (UUID, serial number, or other number unique per device)
//
XPlexClientIdentifier string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
}
func (o *GetTokenGlobals) GetXPlexClientIdentifier() string {
func (o *GetTokenGlobals) GetXPlexClientIdentifier() *string {
if o == nil {
return ""
return nil
}
return o.XPlexClientIdentifier
}

View File

@@ -0,0 +1,530 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/internal/utils"
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/types"
"net/http"
)
type GetTopWatchedContentRequest struct {
// the library type (1 - movies, 2 - shows, 3 - music)
Type int64 `queryParam:"style=form,explode=true,name=type"`
// Adds the Guids object to the response
//
IncludeGuids *int64 `queryParam:"style=form,explode=true,name=includeGuids"`
}
func (o *GetTopWatchedContentRequest) GetType() int64 {
if o == nil {
return 0
}
return o.Type
}
func (o *GetTopWatchedContentRequest) GetIncludeGuids() *int64 {
if o == nil {
return nil
}
return o.IncludeGuids
}
type GetTopWatchedContentGenre struct {
ID *int `json:"id,omitempty"`
Filter *string `json:"filter,omitempty"`
Tag *string `json:"tag,omitempty"`
}
func (o *GetTopWatchedContentGenre) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetTopWatchedContentGenre) GetFilter() *string {
if o == nil {
return nil
}
return o.Filter
}
func (o *GetTopWatchedContentGenre) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetTopWatchedContentCountry struct {
ID *int `json:"id,omitempty"`
Filter *string `json:"filter,omitempty"`
Tag *string `json:"tag,omitempty"`
}
func (o *GetTopWatchedContentCountry) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetTopWatchedContentCountry) GetFilter() *string {
if o == nil {
return nil
}
return o.Filter
}
func (o *GetTopWatchedContentCountry) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetTopWatchedContentGuids struct {
ID *string `json:"id,omitempty"`
}
func (o *GetTopWatchedContentGuids) GetID() *string {
if o == nil {
return nil
}
return o.ID
}
type GetTopWatchedContentRole struct {
ID *int `json:"id,omitempty"`
Filter *string `json:"filter,omitempty"`
Tag *string `json:"tag,omitempty"`
TagKey *string `json:"tagKey,omitempty"`
Role *string `json:"role,omitempty"`
Thumb *string `json:"thumb,omitempty"`
}
func (o *GetTopWatchedContentRole) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
func (o *GetTopWatchedContentRole) GetFilter() *string {
if o == nil {
return nil
}
return o.Filter
}
func (o *GetTopWatchedContentRole) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
func (o *GetTopWatchedContentRole) GetTagKey() *string {
if o == nil {
return nil
}
return o.TagKey
}
func (o *GetTopWatchedContentRole) GetRole() *string {
if o == nil {
return nil
}
return o.Role
}
func (o *GetTopWatchedContentRole) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
type User struct {
ID *int `json:"id,omitempty"`
}
func (o *User) GetID() *int {
if o == nil {
return nil
}
return o.ID
}
type GetTopWatchedContentMetadata struct {
RatingKey *string `json:"ratingKey,omitempty"`
Key *string `json:"key,omitempty"`
GUID *string `json:"guid,omitempty"`
Slug *string `json:"slug,omitempty"`
Studio *string `json:"studio,omitempty"`
Type *string `json:"type,omitempty"`
Title *string `json:"title,omitempty"`
LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"`
LibrarySectionID *int `json:"librarySectionID,omitempty"`
LibrarySectionKey *string `json:"librarySectionKey,omitempty"`
ContentRating *string `json:"contentRating,omitempty"`
Summary *string `json:"summary,omitempty"`
Index *int64 `json:"index,omitempty"`
AudienceRating *float64 `json:"audienceRating,omitempty"`
Year *int `json:"year,omitempty"`
Tagline *string `json:"tagline,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Art *string `json:"art,omitempty"`
Duration *int `json:"duration,omitempty"`
OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"`
LeafCount *int64 `json:"leafCount,omitempty"`
ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"`
ChildCount *int64 `json:"childCount,omitempty"`
AddedAt *int `json:"addedAt,omitempty"`
UpdatedAt *int `json:"updatedAt,omitempty"`
GlobalViewCount *int64 `json:"globalViewCount,omitempty"`
AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
Genre []GetTopWatchedContentGenre `json:"Genre,omitempty"`
Country []GetTopWatchedContentCountry `json:"Country,omitempty"`
Guids []GetTopWatchedContentGuids `json:"Guid,omitempty"`
Role []GetTopWatchedContentRole `json:"Role,omitempty"`
User []User `json:"User,omitempty"`
}
func (g GetTopWatchedContentMetadata) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetTopWatchedContentMetadata) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetTopWatchedContentMetadata) GetRatingKey() *string {
if o == nil {
return nil
}
return o.RatingKey
}
func (o *GetTopWatchedContentMetadata) GetKey() *string {
if o == nil {
return nil
}
return o.Key
}
func (o *GetTopWatchedContentMetadata) GetGUID() *string {
if o == nil {
return nil
}
return o.GUID
}
func (o *GetTopWatchedContentMetadata) GetSlug() *string {
if o == nil {
return nil
}
return o.Slug
}
func (o *GetTopWatchedContentMetadata) GetStudio() *string {
if o == nil {
return nil
}
return o.Studio
}
func (o *GetTopWatchedContentMetadata) GetType() *string {
if o == nil {
return nil
}
return o.Type
}
func (o *GetTopWatchedContentMetadata) GetTitle() *string {
if o == nil {
return nil
}
return o.Title
}
func (o *GetTopWatchedContentMetadata) GetLibrarySectionTitle() *string {
if o == nil {
return nil
}
return o.LibrarySectionTitle
}
func (o *GetTopWatchedContentMetadata) GetLibrarySectionID() *int {
if o == nil {
return nil
}
return o.LibrarySectionID
}
func (o *GetTopWatchedContentMetadata) GetLibrarySectionKey() *string {
if o == nil {
return nil
}
return o.LibrarySectionKey
}
func (o *GetTopWatchedContentMetadata) GetContentRating() *string {
if o == nil {
return nil
}
return o.ContentRating
}
func (o *GetTopWatchedContentMetadata) GetSummary() *string {
if o == nil {
return nil
}
return o.Summary
}
func (o *GetTopWatchedContentMetadata) GetIndex() *int64 {
if o == nil {
return nil
}
return o.Index
}
func (o *GetTopWatchedContentMetadata) GetAudienceRating() *float64 {
if o == nil {
return nil
}
return o.AudienceRating
}
func (o *GetTopWatchedContentMetadata) GetYear() *int {
if o == nil {
return nil
}
return o.Year
}
func (o *GetTopWatchedContentMetadata) GetTagline() *string {
if o == nil {
return nil
}
return o.Tagline
}
func (o *GetTopWatchedContentMetadata) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetTopWatchedContentMetadata) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetTopWatchedContentMetadata) GetDuration() *int {
if o == nil {
return nil
}
return o.Duration
}
func (o *GetTopWatchedContentMetadata) GetOriginallyAvailableAt() *types.Date {
if o == nil {
return nil
}
return o.OriginallyAvailableAt
}
func (o *GetTopWatchedContentMetadata) GetLeafCount() *int64 {
if o == nil {
return nil
}
return o.LeafCount
}
func (o *GetTopWatchedContentMetadata) GetViewedLeafCount() *int64 {
if o == nil {
return nil
}
return o.ViewedLeafCount
}
func (o *GetTopWatchedContentMetadata) GetChildCount() *int64 {
if o == nil {
return nil
}
return o.ChildCount
}
func (o *GetTopWatchedContentMetadata) GetAddedAt() *int {
if o == nil {
return nil
}
return o.AddedAt
}
func (o *GetTopWatchedContentMetadata) GetUpdatedAt() *int {
if o == nil {
return nil
}
return o.UpdatedAt
}
func (o *GetTopWatchedContentMetadata) GetGlobalViewCount() *int64 {
if o == nil {
return nil
}
return o.GlobalViewCount
}
func (o *GetTopWatchedContentMetadata) GetAudienceRatingImage() *string {
if o == nil {
return nil
}
return o.AudienceRatingImage
}
func (o *GetTopWatchedContentMetadata) GetGenre() []GetTopWatchedContentGenre {
if o == nil {
return nil
}
return o.Genre
}
func (o *GetTopWatchedContentMetadata) GetCountry() []GetTopWatchedContentCountry {
if o == nil {
return nil
}
return o.Country
}
func (o *GetTopWatchedContentMetadata) GetGuids() []GetTopWatchedContentGuids {
if o == nil {
return nil
}
return o.Guids
}
func (o *GetTopWatchedContentMetadata) GetRole() []GetTopWatchedContentRole {
if o == nil {
return nil
}
return o.Role
}
func (o *GetTopWatchedContentMetadata) GetUser() []User {
if o == nil {
return nil
}
return o.User
}
type GetTopWatchedContentMediaContainer struct {
Size *int `json:"size,omitempty"`
AllowSync *bool `json:"allowSync,omitempty"`
Identifier *string `json:"identifier,omitempty"`
MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"`
MediaTagVersion *int `json:"mediaTagVersion,omitempty"`
Metadata []GetTopWatchedContentMetadata `json:"Metadata,omitempty"`
}
func (o *GetTopWatchedContentMediaContainer) GetSize() *int {
if o == nil {
return nil
}
return o.Size
}
func (o *GetTopWatchedContentMediaContainer) GetAllowSync() *bool {
if o == nil {
return nil
}
return o.AllowSync
}
func (o *GetTopWatchedContentMediaContainer) GetIdentifier() *string {
if o == nil {
return nil
}
return o.Identifier
}
func (o *GetTopWatchedContentMediaContainer) GetMediaTagPrefix() *string {
if o == nil {
return nil
}
return o.MediaTagPrefix
}
func (o *GetTopWatchedContentMediaContainer) GetMediaTagVersion() *int {
if o == nil {
return nil
}
return o.MediaTagVersion
}
func (o *GetTopWatchedContentMediaContainer) GetMetadata() []GetTopWatchedContentMetadata {
if o == nil {
return nil
}
return o.Metadata
}
// GetTopWatchedContentResponseBody - The metadata of the library item.
type GetTopWatchedContentResponseBody struct {
MediaContainer *GetTopWatchedContentMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetTopWatchedContentResponseBody) GetMediaContainer() *GetTopWatchedContentMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetTopWatchedContentResponse 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
// The metadata of the library item.
Object *GetTopWatchedContentResponseBody
}
func (o *GetTopWatchedContentResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetTopWatchedContentResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetTopWatchedContentResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetTopWatchedContentResponse) GetObject() *GetTopWatchedContentResponseBody {
if o == nil {
return nil
}
return o.Object
}

View File

@@ -14,19 +14,19 @@ var GetWatchlistServerList = []string{
"https://metadata.provider.plex.tv",
}
// Filter
type Filter string
// PathParamFilter - Filter
type PathParamFilter string
const (
FilterAll Filter = "all"
FilterAvailable Filter = "available"
FilterReleased Filter = "released"
PathParamFilterAll PathParamFilter = "all"
PathParamFilterAvailable PathParamFilter = "available"
PathParamFilterReleased PathParamFilter = "released"
)
func (e Filter) ToPointer() *Filter {
func (e PathParamFilter) ToPointer() *PathParamFilter {
return &e
}
func (e *Filter) UnmarshalJSON(data []byte) error {
func (e *PathParamFilter) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
@@ -37,10 +37,10 @@ func (e *Filter) UnmarshalJSON(data []byte) error {
case "available":
fallthrough
case "released":
*e = Filter(v)
*e = PathParamFilter(v)
return nil
default:
return fmt.Errorf("invalid value for Filter: %v", v)
return fmt.Errorf("invalid value for PathParamFilter: %v", v)
}
}
@@ -127,7 +127,7 @@ func (e *IncludeExternalMedia) UnmarshalJSON(data []byte) error {
type GetWatchlistRequest struct {
// Filter
Filter Filter `pathParam:"style=simple,explode=false,name=filter"`
Filter PathParamFilter `pathParam:"style=simple,explode=false,name=filter"`
// In the format "field:dir". Available fields are "watchlistedAt" (Added At),
// "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
// "dir" can be "asc" or "desc"
@@ -158,9 +158,9 @@ type GetWatchlistRequest struct {
XPlexContainerSize *int `queryParam:"style=form,explode=true,name=X-Plex-Container-Size"`
}
func (o *GetWatchlistRequest) GetFilter() Filter {
func (o *GetWatchlistRequest) GetFilter() PathParamFilter {
if o == nil {
return Filter("")
return PathParamFilter("")
}
return o.Filter
}