1
0
Fork 0
mirror of synced 2024-07-07 15:36:19 +12:00
appwrite/app/sdks/go/locale.go
2019-10-13 23:19:06 +03:00

70 lines
1.9 KiB
Go

package appwrite
import (
)
// Locale service
type Locale struct {
client *Client
}
// GetLocale get the current user location based on IP. Returns an object with
// user country code, country name, continent name, continent code, ip address
// and suggested currency. You can use the locale header to get the data in
// supported language.
func (srv *Locale) GetLocale() (map[string]interface{}, error) {
path := "/locale"
params := map[string]interface{}{
}
return srv.client.Call("GET", path, nil, params)
}
// GetCountries list of all countries. You can use the locale header to get
// the data in supported language.
func (srv *Locale) GetCountries() (map[string]interface{}, error) {
path := "/locale/countries"
params := map[string]interface{}{
}
return srv.client.Call("GET", path, nil, params)
}
// GetCountriesEU list of all countries that are currently members of the EU.
// You can use the locale header to get the data in supported language. UK
// brexit date is currently set to 2019-10-31 and will be updated if and when
// needed.
func (srv *Locale) GetCountriesEU() (map[string]interface{}, error) {
path := "/locale/countries/eu"
params := map[string]interface{}{
}
return srv.client.Call("GET", path, nil, params)
}
// GetCountriesPhones list of all countries phone codes. You can use the
// locale header to get the data in supported language.
func (srv *Locale) GetCountriesPhones() (map[string]interface{}, error) {
path := "/locale/countries/phones"
params := map[string]interface{}{
}
return srv.client.Call("GET", path, nil, params)
}
// GetCurrencies list of all currencies, including currency symol, name,
// plural, and decimal digits for all major and minor currencies. You can use
// the locale header to get the data in supported language.
func (srv *Locale) GetCurrencies() (map[string]interface{}, error) {
path := "/locale/currencies"
params := map[string]interface{}{
}
return srv.client.Call("GET", path, nil, params)
}