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 удалений

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

@@ -5,7 +5,6 @@ package model
import (
"encoding/json"
"io"
"net/http"
)
@@ -120,23 +119,11 @@ func (ad *AuthData) ToJson() string {
return string(b)
}
func AuthDataFromJson(data io.Reader) *AuthData {
var ad *AuthData
json.NewDecoder(data).Decode(&ad)
return ad
}
func (ar *AuthorizeRequest) ToJson() string {
b, _ := json.Marshal(ar)
return string(b)
}
func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest {
var ar *AuthorizeRequest
json.NewDecoder(data).Decode(&ar)
return ar
}
func (ad *AuthData) IsExpired() bool {
return GetMillis() > ad.CreateAt+int64(ad.ExpiresIn*1000)
}