From faa5474d224a29b41dc3000cb69093bc41f2e501 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Wed, 3 Aug 2022 23:08:50 +0200 Subject: [PATCH] added id types --- types.go | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/types.go b/types.go index 970bd6d..d37e6fc 100644 --- a/types.go +++ b/types.go @@ -9,8 +9,10 @@ type User struct { Name string `json:"name,omitempty"` } +type MediaID int + type Media struct { - ID int `json:"id"` + ID MediaID `json:"id"` Title MediaTitle `json:"title"` Type MediaType `json:"type"` Format MediaFormat `json:"format"` @@ -113,10 +115,12 @@ const ( MediaSourcePictureBook MediaSource = "PICTURE_BOOK" ) +type MediaTrailerID string + type MediaTrailer struct { - ID string `json:"id"` - Site string `json:"site"` - Thumbnail string `json:"thumbnail"` + ID MediaTrailerID `json:"id"` + Site string `json:"site"` + Thumbnail string `json:"thumbnail"` } type MediaCoverImage struct { @@ -126,8 +130,10 @@ type MediaCoverImage struct { Color string `json:"color"` } +type MediaTagID int + type MediaTag struct { - ID int `json:"id"` + MediaTagID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` @@ -173,8 +179,10 @@ func (d Seconds) Duration() time.Duration { return time.Duration(d) * time.Second } +type MediaListID int + type MediaList struct { - ID int `json:"id"` + ID MediaListID `json:"id"` UserID int `json:"userId"` MediaID int `json:"mediaId"` Status MediaListStatus `json:"status"` @@ -205,10 +213,12 @@ const ( MediaListStatusRepeating MediaListStatus = "REPEATING" ) +type AiringScheduleID int + type AiringSchedule struct { - ID int `json:"id"` - MediaID int `json:"mediaId"` - AiringAt UnixTime `json:"airingAt"` - TimeUntilAiring Seconds `json:"timeUntilAiring"` - Episode int `json:"episode"` + ID AiringScheduleID `json:"id"` + MediaID int `json:"mediaId"` + AiringAt UnixTime `json:"airingAt"` + TimeUntilAiring Seconds `json:"timeUntilAiring"` + Episode int `json:"episode"` }