(clientID string)
| 187 | } |
| 188 | |
| 189 | func (client Client) ValidateClientUser(clientID string) error { |
| 190 | request, err := client.newRequest(requestOptions{ |
| 191 | RequestName: internal.GetClientUser, |
| 192 | Header: http.Header{ |
| 193 | "Content-Type": {"application/json"}, |
| 194 | }, |
| 195 | URIParams: map[string]string{"client_id": clientID}, |
| 196 | }) |
| 197 | if err != nil { |
| 198 | return err |
| 199 | } |
| 200 | err = client.connection.Make(request, &Response{}) |
| 201 | |
| 202 | if errType, ok := err.(RawHTTPStatusError); ok { |
| 203 | switch errType.StatusCode { |
| 204 | case http.StatusNotFound: |
| 205 | return actionerror.UserNotFoundError{Username: clientID} |
| 206 | case http.StatusForbidden: |
| 207 | return InsufficientScopeError{} |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | return err |
| 212 | } |
nothing calls this directly
no test coverage detected