1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-09-19 19:00:11 +00:00
jfa-go/jellyseerr/models.go
Harvey Tindall 9c34192b4f
jellyseerr: start API client
Currently uses an API key (Seems simpler for the user than importing the
jfa-go user and granting perms). Strategy as follows:
* MustGetUser(jfID) function checks the cache for user, if not, calls
  Jellyseerr's importer passing jfID. From either, the user object is
  returned, which (in later commits) can be used to update the user's
  email (and potentially other info).

My API key is in there rn but its for a local testing instance, who
cares.
2024-07-29 16:46:37 +01:00

42 lines
1.6 KiB
Go

package jellyseerr
import "time"
type User struct {
Permissions int `json:"permissions"`
Warnings []any `json:"warnings"`
ID int `json:"id"`
Email string `json:"email"`
PlexUsername string `json:"plexUsername"`
JellyfinUsername string `json:"jellyfinUsername"`
Username string `json:"username"`
RecoveryLinkExpirationDate any `json:"recoveryLinkExpirationDate"`
UserType int `json:"userType"`
PlexID string `json:"plexId"`
JellyfinUserID string `json:"jellyfinUserId"`
JellyfinDeviceID string `json:"jellyfinDeviceId"`
JellyfinAuthToken string `json:"jellyfinAuthToken"`
PlexToken string `json:"plexToken"`
Avatar string `json:"avatar"`
MovieQuotaLimit any `json:"movieQuotaLimit"`
MovieQuotaDays any `json:"movieQuotaDays"`
TvQuotaLimit any `json:"tvQuotaLimit"`
TvQuotaDays any `json:"tvQuotaDays"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
RequestCount int `json:"requestCount"`
DisplayName string `json:"displayName"`
}
type PageInfo struct {
Pages int `json:"pages"`
PageSize int `json:"pageSize"`
Results int `json:"results"`
Page int `json:"page"`
}
type GetUsersDTO struct {
Page PageInfo `json:"pageInfo"`
Results []User `json:"results"`
}