()
| 6 | ) |
| 7 | |
| 8 | func (client *Client) GetAPIVersion() (string, error) { |
| 9 | type loginResponse struct { |
| 10 | App struct { |
| 11 | Version string `json:"version"` |
| 12 | } `json:"app"` |
| 13 | } |
| 14 | |
| 15 | request, err := client.newRequest(requestOptions{ |
| 16 | Method: http.MethodGet, |
| 17 | URL: fmt.Sprintf("%s/login", client.LoginLink()), |
| 18 | }) |
| 19 | |
| 20 | if err != nil { |
| 21 | return "", err |
| 22 | } |
| 23 | |
| 24 | info := loginResponse{} |
| 25 | response := Response{ |
| 26 | Result: &info, |
| 27 | } |
| 28 | |
| 29 | err = client.connection.Make(request, &response) |
| 30 | if err != nil { |
| 31 | return "", err |
| 32 | } |
| 33 | |
| 34 | return info.App.Version, nil |
| 35 | } |
nothing calls this directly
no test coverage detected