Remove FromJSON functions (Part 1) (#17961)

* Remove FromJSON functions (Part 1)

```release-note
Removed the following functions:
AccessDataFromJson
AccessResponseFromJson
AnalyticsRowFromJson
AnalyticsRowsFromJson
AuditFromJson
AuditsFromJson
AuthDataFromJson
AuthorizeRequestFromJson
BotFromJson
BotPatchFromJson
BotListFromJson
```

* fix tests

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-21 14:17:08 +05:30
коммит произвёл Claudio Costa
родитель 7454680be5
Коммит e199eba313
17 изменённых файлов: 190 добавлений и 380 удалений

Просмотреть файл

@@ -7,6 +7,7 @@ import (
"bytes"
"context"
b64 "encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
@@ -847,9 +848,10 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service
var buf bytes.Buffer
tee := io.TeeReader(resp.Body, &buf)
ar := model.AccessResponseFromJson(tee)
if ar == nil || resp.StatusCode != http.StatusOK {
return nil, "", stateProps, nil, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, fmt.Sprintf("response_body=%s, status_code=%d", buf.String(), resp.StatusCode), http.StatusInternalServerError)
var ar *model.AccessResponse
err = json.NewDecoder(tee).Decode(&ar)
if err != nil || resp.StatusCode != http.StatusOK {
return nil, "", stateProps, nil, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, fmt.Sprintf("response_body=%s, status_code=%d, error=%v", buf.String(), resp.StatusCode, err), http.StatusInternalServerError)
}
if strings.ToLower(ar.TokenType) != model.AccessTokenType {