-
Notifications
You must be signed in to change notification settings - Fork 57
/
certifications.go
32 lines (28 loc) · 952 Bytes
/
certifications.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package tmdb
import (
"fmt"
)
// Certification struct
type Certification struct {
Certifications map[string][]struct {
Certification string
Meaning string
Order int
}
}
// GetCertificationsMovieList for movies
// https://developers.themoviedb.org/3/certifications/get-movie-certifications
func (tmdb *TMDb) GetCertificationsMovieList() (*Certification, error) {
var movieCert Certification
uri := fmt.Sprintf("%s/certification/movie/list?api_key=%s", baseURL, tmdb.apiKey)
result, err := getTmdb(uri, &movieCert)
return result.(*Certification), err
}
// GetCertificationsTvList for tv shows
// https://developers.themoviedb.org/3/certifications/get-tv-certifications
func (tmdb *TMDb) GetCertificationsTvList() (*Certification, error) {
var tvCert Certification
uri := fmt.Sprintf("%s/certification/tv/list?api_key=%s", baseURL, tmdb.apiKey)
result, err := getTmdb(uri, &tvCert)
return result.(*Certification), err
}