2024-07-24 09:18:45 -04:00
export namespace main {
export class AniListCurrentUserWatchList {
2024-07-25 09:18:46 -04:00
data : struct { Page struct { PageInfo struct { Total int "json:\"total\"" ; PerPage int "json:\"perPage\"" ; CurrentPage int "json:\"currentPage\"" ; LastPage int "json:\"lastPage\"" ; HasNextPage bool "json:\"hasNextPage\"" } "json:\"pageInfo\"" ; MediaList [ ] main . ;
2024-07-24 09:18:45 -04:00
static createFrom ( source : any = { } ) {
return new AniListCurrentUserWatchList ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . data = this . convertValues ( source [ "data" ] , Object ) ;
}
convertValues ( a : any , classs : any , asMap : boolean = false ) : any {
if ( ! a ) {
return a ;
}
if ( a . slice && a . map ) {
return ( a as any [ ] ) . map ( elem = > this . convertValues ( elem , classs ) ) ;
} else if ( "object" === typeof a ) {
if ( asMap ) {
for ( const key of Object . keys ( a ) ) {
a [ key ] = new classs ( a [ key ] ) ;
}
return a ;
}
return new classs ( a ) ;
}
return a ;
}
}
2024-07-25 09:18:46 -04:00
export class AniListGetSingleAnime {
data : struct { MediaList main . ;
static createFrom ( source : any = { } ) {
return new AniListGetSingleAnime ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . data = this . convertValues ( source [ "data" ] , Object ) ;
}
convertValues ( a : any , classs : any , asMap : boolean = false ) : any {
if ( ! a ) {
return a ;
}
if ( a . slice && a . map ) {
return ( a as any [ ] ) . map ( elem = > this . convertValues ( elem , classs ) ) ;
} else if ( "object" === typeof a ) {
if ( asMap ) {
for ( const key of Object . keys ( a ) ) {
a [ key ] = new classs ( a [ key ] ) ;
}
return a ;
}
return new classs ( a ) ;
}
return a ;
}
}
2024-07-24 09:18:45 -04:00
export class AniListUser {
2024-07-30 20:41:18 -04:00
// Go type: struct { Viewer struct { ID int "json:\"id\""; Name string "json:\"name\""; Avatar struct { Large string "json:\"large\""; Medium string "json:\"medium\"" } "json:\"avatar\""; BannerImage string "json:\"bannerImage\""; SiteUrl string "json:\"siteUrl\"" } "json:\"Viewer\"" }
2024-07-24 09:18:45 -04:00
data : any ;
static createFrom ( source : any = { } ) {
return new AniListUser ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . data = this . convertValues ( source [ "data" ] , Object ) ;
}
convertValues ( a : any , classs : any , asMap : boolean = false ) : any {
if ( ! a ) {
return a ;
}
if ( a . slice && a . map ) {
return ( a as any [ ] ) . map ( elem = > this . convertValues ( elem , classs ) ) ;
} else if ( "object" === typeof a ) {
if ( asMap ) {
for ( const key of Object . keys ( a ) ) {
a [ key ] = new classs ( a [ key ] ) ;
}
return a ;
}
return new classs ( a ) ;
}
return a ;
}
}
2024-07-25 09:18:46 -04:00
export class MediaList {
id : number ;
mediaId : number ;
userId : number ;
2024-08-09 15:11:20 -04:00
// Go type: struct { ID int "json:\"id\""; IDMal int "json:\"idMal\""; Title struct { Romaji string "json:\"romaji\""; English string "json:\"english\""; Native string "json:\"native\"" } "json:\"title\""; Description string "json:\"description\""; CoverImage struct { Large string "json:\"large\"" } "json:\"coverImage\""; Season string "json:\"season\""; SeasonYear int "json:\"seasonYear\""; Status string "json:\"status\""; Episodes int "json:\"episodes\""; NextAiringEpisode struct { AiringAt int "json:\"airingAt\""; TimeUntilAiring int "json:\"timeUntilAiring\""; Episode int "json:\"episode\"" } "json:\"nextAiringEpisode\""; Tags []struct { Id int "json:\"id\""; Name string "json:\"name\""; Description string "json:\"description\""; Rank int "json:\"rank\""; IsMediaSpoiler bool "json:\"isMediaSpoiler\""; IsAdult bool "json:\"isAdult\"" } "json:\"tags\""; IsAdult bool "json:\"isAdult\"" }
2024-07-25 09:18:46 -04:00
media : any ;
status : string ;
2024-07-27 21:18:03 -04:00
// Go type: struct { Year int "json:\"year\""; Month int "json:\"month\""; Day int "json:\"day\"" }
startedAt : any ;
// Go type: struct { Year int "json:\"year\""; Month int "json:\"month\""; Day int "json:\"day\"" }
completedAt : any ;
2024-07-25 09:18:46 -04:00
notes : string ;
progress : number ;
score : number ;
repeat : number ;
// Go type: struct { ID int "json:\"id\""; Name string "json:\"name\""; Avatar struct { Large string "json:\"large\""; Medium string "json:\"medium\"" } "json:\"avatar\""; Statistics struct { Anime struct { Count int "json:\"count\""; Statuses []struct { Status string "json:\"status\""; Count int "json:\"count\"" } "json:\"statuses\"" } "json:\"anime\"" } "json:\"statistics\"" }
user : any ;
static createFrom ( source : any = { } ) {
return new MediaList ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . id = source [ "id" ] ;
this . mediaId = source [ "mediaId" ] ;
this . userId = source [ "userId" ] ;
this . media = this . convertValues ( source [ "media" ] , Object ) ;
this . status = source [ "status" ] ;
2024-07-27 21:18:03 -04:00
this . startedAt = this . convertValues ( source [ "startedAt" ] , Object ) ;
this . completedAt = this . convertValues ( source [ "completedAt" ] , Object ) ;
2024-07-25 09:18:46 -04:00
this . notes = source [ "notes" ] ;
this . progress = source [ "progress" ] ;
this . score = source [ "score" ] ;
this . repeat = source [ "repeat" ] ;
this . user = this . convertValues ( source [ "user" ] , Object ) ;
}
convertValues ( a : any , classs : any , asMap : boolean = false ) : any {
if ( ! a ) {
return a ;
}
if ( a . slice && a . map ) {
return ( a as any [ ] ) . map ( elem = > this . convertValues ( elem , classs ) ) ;
} else if ( "object" === typeof a ) {
if ( asMap ) {
for ( const key of Object . keys ( a ) ) {
a [ key ] = new classs ( a [ key ] ) ;
2024-07-30 12:59:06 -04:00
}
return a ;
}
return new classs ( a ) ;
}
return a ;
}
}
export class SimklUser {
2024-07-30 20:41:18 -04:00
user : user ;
account : account ;
connections : connections ;
2024-07-30 12:59:06 -04:00
static createFrom ( source : any = { } ) {
return new SimklUser ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
2024-07-30 20:41:18 -04:00
this . user = source [ "user" ] ;
this . account = source [ "account" ] ;
this . connections = source [ "connections" ] ;
2024-07-30 12:59:06 -04:00
}
2024-07-30 20:41:18 -04:00
}
export class SimklWatchList {
anime : anime ;
2024-07-30 12:59:06 -04:00
2024-07-30 20:41:18 -04:00
static createFrom ( source : any = { } ) {
return new SimklWatchList ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . anime = source [ "anime" ] ;
}
2024-07-25 09:18:46 -04:00
}
}
export namespace struct { MediaList main {
export class {
MediaList : main.MediaList ;
static createFrom ( source : any = { } ) {
return new ( source ) ;
}
constructor ( source : any = { } ) {
if ( 'string' === typeof source ) source = JSON . parse ( source ) ;
this . MediaList = this . convertValues ( source [ "MediaList" ] , main . MediaList ) ;
}
convertValues ( a : any , classs : any , asMap : boolean = false ) : any {
if ( ! a ) {
return a ;
}
if ( a . slice && a . map ) {
return ( a as any [ ] ) . map ( elem = > this . convertValues ( elem , classs ) ) ;
} else if ( "object" === typeof a ) {
if ( asMap ) {
for ( const key of Object . keys ( a ) ) {
a [ key ] = new classs ( a [ key ] ) ;
}
return a ;
}
return new classs ( a ) ;
}
return a ;
}
}
2024-07-24 09:18:45 -04:00
}