forked from nikitaksv/apidq-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress.go
42 lines (36 loc) · 1.2 KB
/
address.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
33
34
35
36
37
38
39
40
41
42
package apidq
import (
"context"
"net/http"
"github.com/nikitaksv/apidq-client-go/dto/address"
)
type AddressService struct {
*service
}
// Clean Стандартизация адреса
func (s AddressService) Clean(ctx context.Context, req *address.CleanRequest) (rsp *address.CleanResponse, httpRsp *http.Response, err error) {
rsp = &address.CleanResponse{}
httpRsp, err = s.post(ctx, ServiceAddress, "/v1/clean/address", req, rsp)
if err != nil {
return
}
return
}
// CleanIqdq Стандартизация адреса в формате старого API
func (s AddressService) CleanIqdq(ctx context.Context, req *address.CleanRequest) (rsp *address.CleanIqdqResponse, httpRsp *http.Response, err error) {
rsp = &address.CleanIqdqResponse{}
httpRsp, err = s.post(ctx, ServiceAddress, "/v1/clean/address/iqdq", req, rsp)
if err != nil {
return
}
return
}
// Suggest Подсказки адреса
func (s AddressService) Suggest(ctx context.Context, req *address.SuggestRequest) (rsp *address.SuggestResponse, httpRsp *http.Response, err error) {
rsp = &address.SuggestResponse{}
httpRsp, err = s.post(ctx, ServiceAddress, "/v1/suggest/address", req, rsp)
if err != nil {
return
}
return
}