MM-21357: Use typed constant for channel types (#17928)

* MM-21357: Use typed constant for channel types

https://mattermost.atlassian.net/browse/MM-21357

```release-note
- Introduced a new type ChannelType for all channel types.
- Updated the Client4.UpdateChannelPrivacy method to ChannelType.
```

* Address review comments

```release-note
NONE
```

* telemetry fix

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-20 12:45:26 +05:30
коммит произвёл Claudio Costa
родитель 4968657651
Коммит da7d71ccf7
37 изменённых файлов: 114 добавлений и 101 удалений

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

@@ -14,11 +14,13 @@ import (
"unicode/utf8"
)
type ChannelType string
const (
ChannelTypeOpen = "O"
ChannelTypePrivate = "P"
ChannelTypeDirect = "D"
ChannelTypeGroup = "G"
ChannelTypeOpen ChannelType = "O"
ChannelTypePrivate ChannelType = "P"
ChannelTypeDirect ChannelType = "D"
ChannelTypeGroup ChannelType = "G"
ChannelGroupMaxUsers = 8
ChannelGroupMinUsers = 3
@@ -40,7 +42,7 @@ type Channel struct {
UpdateAt int64 `json:"update_at"`
DeleteAt int64 `json:"delete_at"`
TeamId string `json:"team_id"`
Type string `json:"type"`
Type ChannelType `json:"type"`
DisplayName string `json:"display_name"`
Name string `json:"name"`
Header string `json:"header"`