@@ -2,20 +2,44 @@ package tmdb
22
33import "fmt"
44
5+ type ImagesConfiguration struct {
6+ BaseURL string `json:"base_url"`
7+ SecureBaseURL string `json:"secure_base_url"`
8+ BackdropSizes []string `json:"backdrop_sizes"`
9+ LogoSizes []string `json:"logo_sizes"`
10+ PosterSizes []string `json:"poster_sizes"`
11+ ProfileSizes []string `json:"profile_sizes"`
12+ StillSizes []string `json:"still_sizes"`
13+ }
14+
515// ConfigurationAPI type is a struct for api configuration JSON response.
616type ConfigurationAPI struct {
7- Images struct {
8- BaseURL string `json:"base_url"`
9- SecureBaseURL string `json:"secure_base_url"`
10- BackdropSizes []string `json:"backdrop_sizes"`
11- LogoSizes []string `json:"logo_sizes"`
12- PosterSizes []string `json:"poster_sizes"`
13- ProfileSizes []string `json:"profile_sizes"`
14- StillSizes []string `json:"still_sizes"`
15- } `json:"images"`
16- ChangeKeys []string `json:"change_keys"`
17+ Images ImagesConfiguration `json:"images"`
18+ ChangeKeys []string `json:"change_keys"`
1719}
1820
21+ // ConfigurationCountries type is a struct for countries configuration JSON response.
22+ type ConfigurationCountries []Country
23+
24+ // ConfigurationJobs type is a struct for jobs configuration JSON response.
25+ type ConfigurationJobs []Jobs
26+
27+ // ConfigurationLanguages type is a struct for languages configuration JSON response.
28+ type ConfigurationLanguages []SpokenLanguage
29+
30+ // ConfigurationPrimaryTranslations type is a struct for
31+ // primary translations configuration JSON response.
32+ type ConfigurationPrimaryTranslations []string
33+
34+ type Timezones struct {
35+ Iso3166_1 string `json:"iso_3166_1"`
36+ Zones []string `json:"zones"`
37+ }
38+
39+ // ConfigurationTimezones type is a struct for timezones
40+ // configuration JSON response.
41+ type ConfigurationTimezones []Timezones
42+
1943// GetConfigurationAPI get the system wide configuration information.
2044//
2145// Some elements of the API require some knowledge of
@@ -37,7 +61,7 @@ type ConfigurationAPI struct {
3761// can be useful if you are building an app that consumes data from the
3862// change feed.
3963//
40- // https://developers .themoviedb.org/3 /configuration/get-api-configuration
64+ // https://developer .themoviedb.org/reference /configuration-details
4165func (c * Client ) GetConfigurationAPI () (* ConfigurationAPI , error ) {
4266 tmdbURL := fmt .Sprintf (
4367 "%s/configuration?api_key=%s" ,
@@ -51,17 +75,10 @@ func (c *Client) GetConfigurationAPI() (*ConfigurationAPI, error) {
5175 return & configurationAPI , nil
5276}
5377
54- // ConfigurationCountries type is a struct for countries configuration JSON response.
55- type ConfigurationCountries []struct {
56- Iso3166_1 string `json:"iso_3166_1"`
57- EnglishName string `json:"english_name"`
58- NativeName string `json:"native_name"`
59- }
60-
6178// GetConfigurationCountries get the list of countries
6279// (ISO 3166-1 tags) used throughout TMDb.
6380//
64- // https://developers .themoviedb.org/3 /configuration/get -countries
81+ // https://developer .themoviedb.org/reference /configuration-countries
6582func (c * Client ) GetConfigurationCountries () (
6683 * ConfigurationCountries ,
6784 error ,
@@ -79,15 +96,9 @@ func (c *Client) GetConfigurationCountries() (
7996 return & configurationCountries , nil
8097}
8198
82- // ConfigurationJobs type is a struct for jobs configuration JSON response.
83- type ConfigurationJobs []struct {
84- Department string `json:"department"`
85- Jobs []string `json:"jobs"`
86- }
87-
8899// GetConfigurationJobs get a list of the jobs and departments we use on TMDb.
89100//
90- // https://developers .themoviedb.org/3 /configuration/get -jobs
101+ // https://developer .themoviedb.org/reference /configuration-jobs
91102func (c * Client ) GetConfigurationJobs () (* ConfigurationJobs , error ) {
92103 tmdbURL := fmt .Sprintf (
93104 "%s%sjobs?api_key=%s" ,
@@ -102,17 +113,10 @@ func (c *Client) GetConfigurationJobs() (*ConfigurationJobs, error) {
102113 return & configurationJobs , nil
103114}
104115
105- // ConfigurationLanguages type is a struct for languages configuration JSON response.
106- type ConfigurationLanguages []struct {
107- Iso639_1 string `json:"iso_639_1"`
108- EnglishName string `json:"english_name"`
109- Name string `json:"name"`
110- }
111-
112116// GetConfigurationLanguages get the list of languages
113117// (ISO 639-1 tags) used throughout TMDb.
114118//
115- // https://developers .themoviedb.org/3 /configuration/get -languages
119+ // https://developer .themoviedb.org/reference /configuration-languages
116120func (c * Client ) GetConfigurationLanguages () (
117121 * ConfigurationLanguages ,
118122 error ,
@@ -130,10 +134,6 @@ func (c *Client) GetConfigurationLanguages() (
130134 return & configurationLanguages , nil
131135}
132136
133- // ConfigurationPrimaryTranslations type is a struct for
134- // primary translations configuration JSON response.
135- type ConfigurationPrimaryTranslations []string
136-
137137// GetConfigurationPrimaryTranslations get a list of the officially
138138// supported translations on TMDb.
139139//
@@ -155,7 +155,7 @@ type ConfigurationPrimaryTranslations []string
155155// One more thing to mention, these are the translations that map to
156156// our website translation project.
157157//
158- // https://developers .themoviedb.org/3 /configuration/get -primary-translations
158+ // https://developer .themoviedb.org/reference /configuration-primary-translations
159159func (c * Client ) GetConfigurationPrimaryTranslations () (
160160 * ConfigurationPrimaryTranslations ,
161161 error ,
@@ -171,17 +171,10 @@ func (c *Client) GetConfigurationPrimaryTranslations() (
171171 return & configurationPrimaryTranslations , nil
172172}
173173
174- // ConfigurationTimezones type is a struct for timezones
175- // configuration JSON response.
176- type ConfigurationTimezones []struct {
177- Iso3166_1 string `json:"iso_3166_1"`
178- Zones []string `json:"zones"`
179- }
180-
181174// GetConfigurationTimezones get the list of timezones
182175// used throughout TMDb.
183176//
184- // https://developers .themoviedb.org/3 /configuration/get -timezones
177+ // https://developer .themoviedb.org/reference /configuration-timezones
185178func (c * Client ) GetConfigurationTimezones () (
186179 * ConfigurationTimezones ,
187180 error ,
0 commit comments