mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
1144 lines
30 KiB
Go
1144 lines
30 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||
|
||
package operations
|
||
|
||
import (
|
||
"encoding/json"
|
||
"fmt"
|
||
"github.com/LukeHagar/plexgo/internal/utils"
|
||
"net/http"
|
||
)
|
||
|
||
var PostUsersSignInDataServerList = []string{
|
||
"https://plex.tv/api/v2",
|
||
}
|
||
|
||
// PostUsersSignInDataRequestBody - Login credentials
|
||
type PostUsersSignInDataRequestBody struct {
|
||
Login string `form:"name=login"`
|
||
Password string `form:"name=password"`
|
||
RememberMe *bool `default:"false" form:"name=rememberMe"`
|
||
VerificationCode *string `form:"name=verificationCode"`
|
||
}
|
||
|
||
func (p PostUsersSignInDataRequestBody) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(p, "", false)
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequestBody) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &p, "", false, []string{"login", "password"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequestBody) GetLogin() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Login
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequestBody) GetPassword() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Password
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequestBody) GetRememberMe() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.RememberMe
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequestBody) GetVerificationCode() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.VerificationCode
|
||
}
|
||
|
||
type PostUsersSignInDataRequest struct {
|
||
// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||
ClientID string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
|
||
// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||
ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"`
|
||
// A relatively friendly name for the client device
|
||
DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"`
|
||
// The version of the client application.
|
||
ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"`
|
||
// The platform of the client application.
|
||
Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
|
||
// Login credentials
|
||
RequestBody *PostUsersSignInDataRequestBody `request:"mediaType=application/x-www-form-urlencoded"`
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetClientID() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.ClientID
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetClientName() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.ClientName
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetDeviceNickname() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.DeviceNickname
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetClientVersion() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.ClientVersion
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetPlatform() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Platform
|
||
}
|
||
|
||
func (p *PostUsersSignInDataRequest) GetRequestBody() *PostUsersSignInDataRequestBody {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.RequestBody
|
||
}
|
||
|
||
// PostUsersSignInDataMailingListStatus - Your current mailing list status (active or unsubscribed)
|
||
type PostUsersSignInDataMailingListStatus string
|
||
|
||
const (
|
||
PostUsersSignInDataMailingListStatusActive PostUsersSignInDataMailingListStatus = "active"
|
||
PostUsersSignInDataMailingListStatusUnsubscribed PostUsersSignInDataMailingListStatus = "unsubscribed"
|
||
)
|
||
|
||
func (e PostUsersSignInDataMailingListStatus) ToPointer() *PostUsersSignInDataMailingListStatus {
|
||
return &e
|
||
}
|
||
|
||
// PostUsersSignInDataAutoSelectSubtitle - The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
|
||
type PostUsersSignInDataAutoSelectSubtitle int
|
||
|
||
const (
|
||
PostUsersSignInDataAutoSelectSubtitleDisable PostUsersSignInDataAutoSelectSubtitle = 0
|
||
PostUsersSignInDataAutoSelectSubtitleEnable PostUsersSignInDataAutoSelectSubtitle = 1
|
||
)
|
||
|
||
func (e PostUsersSignInDataAutoSelectSubtitle) ToPointer() *PostUsersSignInDataAutoSelectSubtitle {
|
||
return &e
|
||
}
|
||
func (e *PostUsersSignInDataAutoSelectSubtitle) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = PostUsersSignInDataAutoSelectSubtitle(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for PostUsersSignInDataAutoSelectSubtitle: %v", v)
|
||
}
|
||
}
|
||
|
||
// PostUsersSignInDataDefaultSubtitleAccessibility - The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
|
||
type PostUsersSignInDataDefaultSubtitleAccessibility int
|
||
|
||
const (
|
||
PostUsersSignInDataDefaultSubtitleAccessibilityDisable PostUsersSignInDataDefaultSubtitleAccessibility = 0
|
||
PostUsersSignInDataDefaultSubtitleAccessibilityEnable PostUsersSignInDataDefaultSubtitleAccessibility = 1
|
||
)
|
||
|
||
func (e PostUsersSignInDataDefaultSubtitleAccessibility) ToPointer() *PostUsersSignInDataDefaultSubtitleAccessibility {
|
||
return &e
|
||
}
|
||
func (e *PostUsersSignInDataDefaultSubtitleAccessibility) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = PostUsersSignInDataDefaultSubtitleAccessibility(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for PostUsersSignInDataDefaultSubtitleAccessibility: %v", v)
|
||
}
|
||
}
|
||
|
||
// PostUsersSignInDataDefaultSubtitleForced - The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
|
||
type PostUsersSignInDataDefaultSubtitleForced int
|
||
|
||
const (
|
||
PostUsersSignInDataDefaultSubtitleForcedDisable PostUsersSignInDataDefaultSubtitleForced = 0
|
||
PostUsersSignInDataDefaultSubtitleForcedEnable PostUsersSignInDataDefaultSubtitleForced = 1
|
||
)
|
||
|
||
func (e PostUsersSignInDataDefaultSubtitleForced) ToPointer() *PostUsersSignInDataDefaultSubtitleForced {
|
||
return &e
|
||
}
|
||
func (e *PostUsersSignInDataDefaultSubtitleForced) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = PostUsersSignInDataDefaultSubtitleForced(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for PostUsersSignInDataDefaultSubtitleForced: %v", v)
|
||
}
|
||
}
|
||
|
||
// PostUsersSignInDataWatchedIndicator - Whether or not media watched indicators are enabled (little orange dot on media)
|
||
type PostUsersSignInDataWatchedIndicator int
|
||
|
||
const (
|
||
PostUsersSignInDataWatchedIndicatorDisable PostUsersSignInDataWatchedIndicator = 0
|
||
PostUsersSignInDataWatchedIndicatorEnable PostUsersSignInDataWatchedIndicator = 1
|
||
)
|
||
|
||
func (e PostUsersSignInDataWatchedIndicator) ToPointer() *PostUsersSignInDataWatchedIndicator {
|
||
return &e
|
||
}
|
||
func (e *PostUsersSignInDataWatchedIndicator) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = PostUsersSignInDataWatchedIndicator(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for PostUsersSignInDataWatchedIndicator: %v", v)
|
||
}
|
||
}
|
||
|
||
// PostUsersSignInDataMediaReviewsVisibility - Whether or not the account has media reviews visibility enabled
|
||
type PostUsersSignInDataMediaReviewsVisibility int
|
||
|
||
const (
|
||
PostUsersSignInDataMediaReviewsVisibilityDisable PostUsersSignInDataMediaReviewsVisibility = 0
|
||
PostUsersSignInDataMediaReviewsVisibilityEnable PostUsersSignInDataMediaReviewsVisibility = 1
|
||
)
|
||
|
||
func (e PostUsersSignInDataMediaReviewsVisibility) ToPointer() *PostUsersSignInDataMediaReviewsVisibility {
|
||
return &e
|
||
}
|
||
func (e *PostUsersSignInDataMediaReviewsVisibility) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = PostUsersSignInDataMediaReviewsVisibility(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for PostUsersSignInDataMediaReviewsVisibility: %v", v)
|
||
}
|
||
}
|
||
|
||
type PostUsersSignInDataUserProfile struct {
|
||
// If the account has automatically select audio and subtitle tracks enabled
|
||
AutoSelectAudio *bool `default:"true" json:"autoSelectAudio"`
|
||
// The preferred audio language for the account
|
||
DefaultAudioLanguage *string `json:"defaultAudioLanguage"`
|
||
// The preferred subtitle language for the account
|
||
DefaultSubtitleLanguage *string `json:"defaultSubtitleLanguage"`
|
||
AutoSelectSubtitle *PostUsersSignInDataAutoSelectSubtitle `default:"0" json:"autoSelectSubtitle"`
|
||
DefaultSubtitleAccessibility *PostUsersSignInDataDefaultSubtitleAccessibility `default:"0" json:"defaultSubtitleAccessibility"`
|
||
DefaultSubtitleForced *PostUsersSignInDataDefaultSubtitleForced `default:"0" json:"defaultSubtitleForced"`
|
||
WatchedIndicator *PostUsersSignInDataWatchedIndicator `default:"0" json:"watchedIndicator"`
|
||
MediaReviewsVisibility *PostUsersSignInDataMediaReviewsVisibility `default:"0" json:"mediaReviewsVisibility"`
|
||
}
|
||
|
||
func (p PostUsersSignInDataUserProfile) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(p, "", false)
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetAutoSelectAudio() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AutoSelectAudio
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetDefaultAudioLanguage() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.DefaultAudioLanguage
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleLanguage() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.DefaultSubtitleLanguage
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetAutoSelectSubtitle() *PostUsersSignInDataAutoSelectSubtitle {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AutoSelectSubtitle
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleAccessibility() *PostUsersSignInDataDefaultSubtitleAccessibility {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.DefaultSubtitleAccessibility
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetDefaultSubtitleForced() *PostUsersSignInDataDefaultSubtitleForced {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.DefaultSubtitleForced
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetWatchedIndicator() *PostUsersSignInDataWatchedIndicator {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.WatchedIndicator
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserProfile) GetMediaReviewsVisibility() *PostUsersSignInDataMediaReviewsVisibility {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.MediaReviewsVisibility
|
||
}
|
||
|
||
type PostUsersSignInDataStatus string
|
||
|
||
const (
|
||
PostUsersSignInDataStatusOnline PostUsersSignInDataStatus = "online"
|
||
PostUsersSignInDataStatusOffline PostUsersSignInDataStatus = "offline"
|
||
)
|
||
|
||
func (e PostUsersSignInDataStatus) ToPointer() *PostUsersSignInDataStatus {
|
||
return &e
|
||
}
|
||
|
||
type PostUsersSignInDataServices struct {
|
||
Identifier string `json:"identifier"`
|
||
Endpoint string `json:"endpoint"`
|
||
Token *string `json:"token"`
|
||
Secret *string `json:"secret"`
|
||
Status PostUsersSignInDataStatus `json:"status"`
|
||
}
|
||
|
||
func (p *PostUsersSignInDataServices) GetIdentifier() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Identifier
|
||
}
|
||
|
||
func (p *PostUsersSignInDataServices) GetEndpoint() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Endpoint
|
||
}
|
||
|
||
func (p *PostUsersSignInDataServices) GetToken() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Token
|
||
}
|
||
|
||
func (p *PostUsersSignInDataServices) GetSecret() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Secret
|
||
}
|
||
|
||
func (p *PostUsersSignInDataServices) GetStatus() PostUsersSignInDataStatus {
|
||
if p == nil {
|
||
return PostUsersSignInDataStatus("")
|
||
}
|
||
return p.Status
|
||
}
|
||
|
||
// PostUsersSignInDataAuthenticationStatus - String representation of subscriptionActive
|
||
type PostUsersSignInDataAuthenticationStatus string
|
||
|
||
const (
|
||
PostUsersSignInDataAuthenticationStatusInactive PostUsersSignInDataAuthenticationStatus = "Inactive"
|
||
PostUsersSignInDataAuthenticationStatusActive PostUsersSignInDataAuthenticationStatus = "Active"
|
||
)
|
||
|
||
func (e PostUsersSignInDataAuthenticationStatus) ToPointer() *PostUsersSignInDataAuthenticationStatus {
|
||
return &e
|
||
}
|
||
|
||
// PostUsersSignInDataSubscription - If the account’s Plex Pass subscription is active
|
||
type PostUsersSignInDataSubscription struct {
|
||
// List of features allowed on your Plex Pass subscription
|
||
Features []string `json:"features,omitempty"`
|
||
// If the account's Plex Pass subscription is active
|
||
Active *bool `json:"active,omitempty"`
|
||
// Date the account subscribed to Plex Pass
|
||
SubscribedAt *string `json:"subscribedAt,omitempty"`
|
||
// String representation of subscriptionActive
|
||
Status *PostUsersSignInDataAuthenticationStatus `json:"status,omitempty"`
|
||
// Payment service used for your Plex Pass subscription
|
||
PaymentService *string `json:"paymentService,omitempty"`
|
||
// Name of Plex Pass subscription plan
|
||
Plan *string `json:"plan,omitempty"`
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetFeatures() []string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Features
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetActive() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Active
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetSubscribedAt() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.SubscribedAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetStatus() *PostUsersSignInDataAuthenticationStatus {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Status
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetPaymentService() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.PaymentService
|
||
}
|
||
|
||
func (p *PostUsersSignInDataSubscription) GetPlan() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Plan
|
||
}
|
||
|
||
// PostUsersSignInDataAuthenticationResponseStatus - String representation of subscriptionActive
|
||
type PostUsersSignInDataAuthenticationResponseStatus string
|
||
|
||
const (
|
||
PostUsersSignInDataAuthenticationResponseStatusInactive PostUsersSignInDataAuthenticationResponseStatus = "Inactive"
|
||
PostUsersSignInDataAuthenticationResponseStatusActive PostUsersSignInDataAuthenticationResponseStatus = "Active"
|
||
)
|
||
|
||
func (e PostUsersSignInDataAuthenticationResponseStatus) ToPointer() *PostUsersSignInDataAuthenticationResponseStatus {
|
||
return &e
|
||
}
|
||
|
||
type PostUsersSignInDataAuthenticationSubscription struct {
|
||
// List of features allowed on your Plex Pass subscription
|
||
Features []string `json:"features,omitempty"`
|
||
// If the account's Plex Pass subscription is active
|
||
Active *bool `json:"active,omitempty"`
|
||
// Date the account subscribed to Plex Pass
|
||
SubscribedAt *string `json:"subscribedAt,omitempty"`
|
||
// String representation of subscriptionActive
|
||
Status *PostUsersSignInDataAuthenticationResponseStatus `json:"status,omitempty"`
|
||
// Payment service used for your Plex Pass subscription
|
||
PaymentService *string `json:"paymentService,omitempty"`
|
||
// Name of Plex Pass subscription plan
|
||
Plan *string `json:"plan,omitempty"`
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetFeatures() []string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Features
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetActive() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Active
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetSubscribedAt() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.SubscribedAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetStatus() *PostUsersSignInDataAuthenticationResponseStatus {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Status
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetPaymentService() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.PaymentService
|
||
}
|
||
|
||
func (p *PostUsersSignInDataAuthenticationSubscription) GetPlan() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Plan
|
||
}
|
||
|
||
type PostUsersSignInDataState string
|
||
|
||
const (
|
||
PostUsersSignInDataStateEnded PostUsersSignInDataState = "ended"
|
||
)
|
||
|
||
func (e PostUsersSignInDataState) ToPointer() *PostUsersSignInDataState {
|
||
return &e
|
||
}
|
||
|
||
type InternalPaymentMethod struct {
|
||
}
|
||
|
||
type Billing struct {
|
||
InternalPaymentMethod InternalPaymentMethod `json:"internalPaymentMethod"`
|
||
PaymentMethodID *int64 `json:"paymentMethodId"`
|
||
}
|
||
|
||
func (b *Billing) GetInternalPaymentMethod() InternalPaymentMethod {
|
||
if b == nil {
|
||
return InternalPaymentMethod{}
|
||
}
|
||
return b.InternalPaymentMethod
|
||
}
|
||
|
||
func (b *Billing) GetPaymentMethodID() *int64 {
|
||
if b == nil {
|
||
return nil
|
||
}
|
||
return b.PaymentMethodID
|
||
}
|
||
|
||
type PastSubscription struct {
|
||
ID *string `json:"id"`
|
||
Mode *string `json:"mode"`
|
||
RenewsAt *int64 `json:"renewsAt"`
|
||
EndsAt *int64 `json:"endsAt"`
|
||
Canceled *bool `default:"false" json:"canceled"`
|
||
GracePeriod *bool `default:"false" json:"gracePeriod"`
|
||
OnHold *bool `default:"false" json:"onHold"`
|
||
CanReactivate *bool `default:"false" json:"canReactivate"`
|
||
CanUpgrade *bool `default:"false" json:"canUpgrade"`
|
||
CanDowngrade *bool `default:"false" json:"canDowngrade"`
|
||
CanConvert *bool `default:"false" json:"canConvert"`
|
||
Type string `json:"type"`
|
||
Transfer *string `json:"transfer"`
|
||
State PostUsersSignInDataState `json:"state"`
|
||
Billing Billing `json:"billing"`
|
||
}
|
||
|
||
func (p PastSubscription) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(p, "", false)
|
||
}
|
||
|
||
func (p *PastSubscription) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "state", "billing"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (p *PastSubscription) GetID() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.ID
|
||
}
|
||
|
||
func (p *PastSubscription) GetMode() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Mode
|
||
}
|
||
|
||
func (p *PastSubscription) GetRenewsAt() *int64 {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.RenewsAt
|
||
}
|
||
|
||
func (p *PastSubscription) GetEndsAt() *int64 {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.EndsAt
|
||
}
|
||
|
||
func (p *PastSubscription) GetCanceled() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Canceled
|
||
}
|
||
|
||
func (p *PastSubscription) GetGracePeriod() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.GracePeriod
|
||
}
|
||
|
||
func (p *PastSubscription) GetOnHold() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.OnHold
|
||
}
|
||
|
||
func (p *PastSubscription) GetCanReactivate() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.CanReactivate
|
||
}
|
||
|
||
func (p *PastSubscription) GetCanUpgrade() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.CanUpgrade
|
||
}
|
||
|
||
func (p *PastSubscription) GetCanDowngrade() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.CanDowngrade
|
||
}
|
||
|
||
func (p *PastSubscription) GetCanConvert() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.CanConvert
|
||
}
|
||
|
||
func (p *PastSubscription) GetType() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Type
|
||
}
|
||
|
||
func (p *PastSubscription) GetTransfer() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Transfer
|
||
}
|
||
|
||
func (p *PastSubscription) GetState() PostUsersSignInDataState {
|
||
if p == nil {
|
||
return PostUsersSignInDataState("")
|
||
}
|
||
return p.State
|
||
}
|
||
|
||
func (p *PastSubscription) GetBilling() Billing {
|
||
if p == nil {
|
||
return Billing{}
|
||
}
|
||
return p.Billing
|
||
}
|
||
|
||
type Trials struct {
|
||
}
|
||
|
||
// PostUsersSignInDataUserPlexAccount - Returns the user account data with a valid auth token
|
||
type PostUsersSignInDataUserPlexAccount struct {
|
||
// Unknown
|
||
AdsConsent *bool `json:"adsConsent"`
|
||
AdsConsentReminderAt *int64 `json:"adsConsentReminderAt"`
|
||
AdsConsentSetAt *int64 `json:"adsConsentSetAt"`
|
||
// Unknown
|
||
Anonymous *bool `default:"false" json:"anonymous"`
|
||
// The account token
|
||
AuthToken string `json:"authToken"`
|
||
// If the two-factor authentication backup codes have been created
|
||
BackupCodesCreated *bool `default:"false" json:"backupCodesCreated"`
|
||
// If the account has been confirmed
|
||
Confirmed *bool `default:"false" json:"confirmed"`
|
||
// The account country
|
||
Country string `json:"country"`
|
||
// The account email address
|
||
Email string `json:"email"`
|
||
// If login with email only is enabled
|
||
EmailOnlyAuth *bool `default:"false" json:"emailOnlyAuth"`
|
||
// If experimental features are enabled
|
||
ExperimentalFeatures *bool `default:"false" json:"experimentalFeatures"`
|
||
// Your account full name
|
||
FriendlyName string `json:"friendlyName"`
|
||
// List of devices your allowed to use with this account
|
||
Entitlements []string `json:"entitlements"`
|
||
// If the account is a Plex Home guest user
|
||
Guest *bool `default:"false" json:"guest"`
|
||
// If the account has a password
|
||
HasPassword *bool `default:"true" json:"hasPassword"`
|
||
// If the account is a Plex Home user
|
||
Home *bool `default:"false" json:"home"`
|
||
// If the account is the Plex Home admin
|
||
HomeAdmin *bool `default:"false" json:"homeAdmin"`
|
||
// The number of accounts in the Plex Home
|
||
HomeSize int `json:"homeSize"`
|
||
// The Plex account ID
|
||
ID int `json:"id"`
|
||
// Unix epoch datetime in seconds
|
||
JoinedAt int64 `json:"joinedAt"`
|
||
// The account locale
|
||
Locale *string `json:"locale"`
|
||
// If you are subscribed to the Plex newsletter
|
||
MailingListActive *bool `default:"false" json:"mailingListActive"`
|
||
// Your current mailing list status (active or unsubscribed)
|
||
MailingListStatus PostUsersSignInDataMailingListStatus `json:"mailingListStatus"`
|
||
// The maximum number of accounts allowed in the Plex Home
|
||
MaxHomeSize int `json:"maxHomeSize"`
|
||
// [Might be removed] The hashed Plex Home PIN
|
||
//
|
||
// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.
|
||
Pin *string `json:"pin,omitempty"`
|
||
Profile PostUsersSignInDataUserProfile `json:"profile"`
|
||
// If the account has a Plex Home PIN enabled
|
||
Protected *bool `default:"false" json:"protected"`
|
||
// Unix epoch datetime in seconds
|
||
RememberExpiresAt int64 `json:"rememberExpiresAt"`
|
||
// If the account is a Plex Home managed user
|
||
Restricted *bool `default:"false" json:"restricted"`
|
||
// [Might be removed] List of account roles. Plexpass membership listed here
|
||
Roles []string `json:"roles,omitempty"`
|
||
// Unknown
|
||
ScrobbleTypes string `json:"scrobbleTypes"`
|
||
Services []PostUsersSignInDataServices `json:"services"`
|
||
// If the account’s Plex Pass subscription is active
|
||
Subscription PostUsersSignInDataSubscription `json:"subscription"`
|
||
// Description of the Plex Pass subscription
|
||
SubscriptionDescription *string `json:"subscriptionDescription"`
|
||
Subscriptions []PostUsersSignInDataAuthenticationSubscription `json:"subscriptions,omitempty"`
|
||
// URL of the account thumbnail
|
||
Thumb string `json:"thumb"`
|
||
// The title of the account (username or friendly name)
|
||
Title string `json:"title"`
|
||
// If two-factor authentication is enabled
|
||
TwoFactorEnabled *bool `default:"false" json:"twoFactorEnabled"`
|
||
// The account username
|
||
Username string `json:"username"`
|
||
// The account UUID
|
||
UUID string `json:"uuid"`
|
||
AttributionPartner *string `json:"attributionPartner"`
|
||
PastSubscriptions []PastSubscription `json:"pastSubscriptions"`
|
||
Trials []Trials `json:"trials"`
|
||
}
|
||
|
||
func (p PostUsersSignInDataUserPlexAccount) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(p, "", false)
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &p, "", false, []string{"authToken", "country", "email", "friendlyName", "entitlements", "homeSize", "id", "joinedAt", "mailingListStatus", "maxHomeSize", "profile", "rememberExpiresAt", "scrobbleTypes", "services", "subscription", "thumb", "title", "username", "uuid", "pastSubscriptions", "trials"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsent() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AdsConsent
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsentReminderAt() *int64 {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AdsConsentReminderAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAdsConsentSetAt() *int64 {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AdsConsentSetAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAnonymous() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Anonymous
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAuthToken() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.AuthToken
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetBackupCodesCreated() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.BackupCodesCreated
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetConfirmed() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Confirmed
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetCountry() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Country
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetEmail() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Email
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetEmailOnlyAuth() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.EmailOnlyAuth
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetExperimentalFeatures() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.ExperimentalFeatures
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetFriendlyName() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.FriendlyName
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetEntitlements() []string {
|
||
if p == nil {
|
||
return []string{}
|
||
}
|
||
return p.Entitlements
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetGuest() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Guest
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetHasPassword() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.HasPassword
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetHome() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Home
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetHomeAdmin() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.HomeAdmin
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetHomeSize() int {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.HomeSize
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetID() int {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.ID
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetJoinedAt() int64 {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.JoinedAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetLocale() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Locale
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetMailingListActive() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.MailingListActive
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetMailingListStatus() PostUsersSignInDataMailingListStatus {
|
||
if p == nil {
|
||
return PostUsersSignInDataMailingListStatus("")
|
||
}
|
||
return p.MailingListStatus
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetMaxHomeSize() int {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.MaxHomeSize
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetPin() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Pin
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetProfile() PostUsersSignInDataUserProfile {
|
||
if p == nil {
|
||
return PostUsersSignInDataUserProfile{}
|
||
}
|
||
return p.Profile
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetProtected() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Protected
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetRememberExpiresAt() int64 {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.RememberExpiresAt
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetRestricted() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Restricted
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetRoles() []string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Roles
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetScrobbleTypes() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.ScrobbleTypes
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetServices() []PostUsersSignInDataServices {
|
||
if p == nil {
|
||
return []PostUsersSignInDataServices{}
|
||
}
|
||
return p.Services
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetSubscription() PostUsersSignInDataSubscription {
|
||
if p == nil {
|
||
return PostUsersSignInDataSubscription{}
|
||
}
|
||
return p.Subscription
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetSubscriptionDescription() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.SubscriptionDescription
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetSubscriptions() []PostUsersSignInDataAuthenticationSubscription {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Subscriptions
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetThumb() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Thumb
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetTitle() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Title
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetTwoFactorEnabled() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.TwoFactorEnabled
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetUsername() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Username
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetUUID() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.UUID
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetAttributionPartner() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AttributionPartner
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetPastSubscriptions() []PastSubscription {
|
||
if p == nil {
|
||
return []PastSubscription{}
|
||
}
|
||
return p.PastSubscriptions
|
||
}
|
||
|
||
func (p *PostUsersSignInDataUserPlexAccount) GetTrials() []Trials {
|
||
if p == nil {
|
||
return []Trials{}
|
||
}
|
||
return p.Trials
|
||
}
|
||
|
||
type PostUsersSignInDataResponse 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
|
||
// Returns the user account data with a valid auth token
|
||
UserPlexAccount *PostUsersSignInDataUserPlexAccount
|
||
}
|
||
|
||
func (p *PostUsersSignInDataResponse) GetContentType() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.ContentType
|
||
}
|
||
|
||
func (p *PostUsersSignInDataResponse) GetStatusCode() int {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.StatusCode
|
||
}
|
||
|
||
func (p *PostUsersSignInDataResponse) GetRawResponse() *http.Response {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.RawResponse
|
||
}
|
||
|
||
func (p *PostUsersSignInDataResponse) GetUserPlexAccount() *PostUsersSignInDataUserPlexAccount {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.UserPlexAccount
|
||
}
|