diff --git a/api/suggest/model.go b/api/suggest/model.go index 851952e..8203934 100644 --- a/api/suggest/model.go +++ b/api/suggest/model.go @@ -43,7 +43,7 @@ type ( Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input) Query string `json:"query"` // user input for suggestion Count int `json:"count"` // ligmit for results - Language *string `json:"language,omitempty"` + Language string `json:"language,omitempty"` Locations []*RequestParamsLocation `json:"locations"` RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results diff --git a/dadata_test.go b/dadata_test.go index 31e44b5..cfbdc7a 100644 --- a/dadata_test.go +++ b/dadata_test.go @@ -53,6 +53,34 @@ func (s *ApiSuggestIntegrationTest) TestAddress() { s.NotEmpty(res) } +func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamRU() { + api := NewSuggestApi() + + params := suggest.RequestParams{ + Query: "ул Свободы", + Language: "RU", + } + + res, err := api.Address(context.Background(), ¶ms) + + s.NoError(err) + s.NotEmpty(res) +} + +func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamEN() { + api := NewSuggestApi() + + params := suggest.RequestParams{ + Query: "ул Свободы", + Language: "EN", + } + + res, err := api.Address(context.Background(), ¶ms) + + s.NoError(err) + s.NotEmpty(res) +} + func (s *ApiSuggestIntegrationTest) TestBank() { api := NewSuggestApi() params := suggest.RequestParams{