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

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

@@ -60,7 +60,7 @@ func AuditModelTypeConv(val interface{}) (newVal interface{}, converted bool) {
type auditChannel struct {
ID string
Name string
Type string
Type ChannelType
}
// newAuditChannel creates a simplified representation of Channel for output to audit log.
@@ -77,7 +77,7 @@ func newAuditChannel(c *Channel) auditChannel {
func (c auditChannel) MarshalJSONObject(enc *gojay.Encoder) {
enc.StringKey("id", c.ID)
enc.StringKey("name", c.Name)
enc.StringKey("type", c.Type)
enc.StringKey("type", string(c.Type))
}
func (c auditChannel) IsNil() bool {