tmdb - certifications.go
1 package tmdb
2
3 import "net/url"
4
5 // Certification represents a single certification description
6 type Certification struct {
7 Certification string `json:"certification"`
8 Meaning string `json:"meaning"`
9 Order int64 `json:"order"`
10 }
11
12 // Certifications represents the certifications founds in numerous countries
13 type Certifications struct {
14 US, CA, AU, FR, RU, DE, TH, KR, GB, BR []Certification
15 }
16
17 // CertificationMovie retrieves all movie certifications
18 func (t *TMDB) CertificationMovie() (*Certification, error) {
19 c := new(Certification)
20 if err := t.get(c, "/3/certification/movie/list", url.Values{}); err != nil {
21 return nil, err
22 }
23 return c, nil
24 }
25
26 // CertificationTV retrieves all tv certifications
27 func (t *TMDB) CertificationTV() (*Certification, error) {
28 c := new(Certification)
29 if err := t.get(c, "/3/certification/tv/list", url.Values{}); err != nil {
30 return nil, err
31 }
32 return c, nil
33 }