Skip to content

Commit

Permalink
extract BelongsToCollection struct (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddox authored Dec 10, 2024
1 parent bf64753 commit 9ca65b6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions movies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import (
jsoniter "github.com/json-iterator/go"
)

// BelongsToCollection type is a struct for a collection the movie is a part of.
type BelongsToCollection struct {
ID int64 `json:"id"`
Name string `json:"name"`
PosterPath string `json:"poster_path"`
BackdropPath string `json:"backdrop_path"`
}

// MovieDetails type is a struct for movie details JSON response.
type MovieDetails struct {
Adult bool `json:"adult"`
BackdropPath string `json:"backdrop_path"`
BelongsToCollection struct {
ID int64 `json:"id"`
Name string `json:"name"`
PosterPath string `json:"poster_path"`
BackdropPath string `json:"backdrop_path"`
} `json:"belongs_to_collection"`
Budget int64 `json:"budget"`
Genres []struct {
Adult bool `json:"adult"`
BackdropPath string `json:"backdrop_path"`
BelongsToCollection BelongsToCollection `json:"belongs_to_collection"`
Budget int64 `json:"budget"`
Genres []struct {
ID int64 `json:"id"`
Name string `json:"name"`
} `json:"genres"`
Expand Down

0 comments on commit 9ca65b6

Please sign in to comment.