/
user_connections.go
41 lines (32 loc) · 1003 Bytes
/
user_connections.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
package pipedrive
import (
"context"
"net/http"
)
// UserConnectionsService handles activities related
// methods of the Pipedrive API.
//
// Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserConnections
type UserConnectionsService service
// UserConnections represents a Pipedrive user connections.
type UserConnections struct {
Success bool `json:"success"`
Data struct {
Google string `json:"google"`
} `json:"data"`
}
// List returns data about all connections for authorized user.
//
// Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserConnections/get_userConnections
func (s *UserConnectionsService) List(ctx context.Context) (*UserConnections, *Response, error) {
req, err := s.client.NewRequest(http.MethodGet, "/userConnections", nil, nil)
if err != nil {
return nil, nil, err
}
var record *UserConnections
resp, err := s.client.Do(ctx, req, &record)
if err != nil {
return nil, resp, err
}
return record, resp, nil
}