Files
plexgo/models/operations/getuserfriends.go

189 lines
3.5 KiB
Go

// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package operations
import (
"github.com/LukeHagar/plexgo/internal/utils"
"net/http"
)
var GetUserFriendsServerList = []string{
"https://plex.tv/api/v2",
}
type SharedServers struct {
}
type SharedSources struct {
}
// Status - Current friend request status
type Status string
const (
StatusAccepted Status = "accepted"
)
func (e Status) ToPointer() *Status {
return &e
}
type Friend struct {
// The account email address
Email string `json:"email"`
// The account full name
FriendlyName *string `json:"friendlyName"`
// If the account is a Plex Home user
Home bool `json:"home"`
// The Plex account ID
ID int `json:"id"`
// If the account is a Plex Home managed user
Restricted *bool `default:"false" json:"restricted"`
SharedServers []SharedServers `json:"sharedServers"`
SharedSources []SharedSources `json:"sharedSources"`
// Current friend request status
Status Status `json:"status"`
// URL of the account thumbnail
Thumb string `json:"thumb"`
// The title of the account (username or friendly name)
Title string `json:"title"`
// The account username
Username string `json:"username"`
// The account Universally Unique Identifier (UUID)
UUID string `json:"uuid"`
}
func (f Friend) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(f, "", false)
}
func (f *Friend) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &f, "", false, []string{"email", "home", "id", "sharedServers", "sharedSources", "status", "thumb", "title", "username", "uuid"}); err != nil {
return err
}
return nil
}
func (f *Friend) GetEmail() string {
if f == nil {
return ""
}
return f.Email
}
func (f *Friend) GetFriendlyName() *string {
if f == nil {
return nil
}
return f.FriendlyName
}
func (f *Friend) GetHome() bool {
if f == nil {
return false
}
return f.Home
}
func (f *Friend) GetID() int {
if f == nil {
return 0
}
return f.ID
}
func (f *Friend) GetRestricted() *bool {
if f == nil {
return nil
}
return f.Restricted
}
func (f *Friend) GetSharedServers() []SharedServers {
if f == nil {
return []SharedServers{}
}
return f.SharedServers
}
func (f *Friend) GetSharedSources() []SharedSources {
if f == nil {
return []SharedSources{}
}
return f.SharedSources
}
func (f *Friend) GetStatus() Status {
if f == nil {
return Status("")
}
return f.Status
}
func (f *Friend) GetThumb() string {
if f == nil {
return ""
}
return f.Thumb
}
func (f *Friend) GetTitle() string {
if f == nil {
return ""
}
return f.Title
}
func (f *Friend) GetUsername() string {
if f == nil {
return ""
}
return f.Username
}
func (f *Friend) GetUUID() string {
if f == nil {
return ""
}
return f.UUID
}
type GetUserFriendsResponse 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
// Friends Data
Friends []Friend
}
func (g *GetUserFriendsResponse) GetContentType() string {
if g == nil {
return ""
}
return g.ContentType
}
func (g *GetUserFriendsResponse) GetStatusCode() int {
if g == nil {
return 0
}
return g.StatusCode
}
func (g *GetUserFriendsResponse) GetRawResponse() *http.Response {
if g == nil {
return nil
}
return g.RawResponse
}
func (g *GetUserFriendsResponse) GetFriends() []Friend {
if g == nil {
return nil
}
return g.Friends
}