func (x *OAuthAccessToken) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "user_ids", "userIds":
			s.AddField("user_ids")
			var v UserIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.UserIds = v
		case "user_session_id", "userSessionId":
			s.AddField("user_session_id")
			x.UserSessionId = s.ReadString()
		case "client_ids", "clientIds":
			s.AddField("client_ids")
			var v ClientIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.ClientIds = v
		case "id":
			s.AddField("id")
			x.Id = s.ReadString()
		case "access_token", "accessToken":
			s.AddField("access_token")
			x.AccessToken = s.ReadString()
		case "refresh_token", "refreshToken":
			s.AddField("refresh_token")
			x.RefreshToken = s.ReadString()
		case "rights":
			s.AddField("rights")
			s.ReadArray(func() {
				var v Right
				v.UnmarshalProtoJSON(s)
				x.Rights = append(x.Rights, v)
			})
		case "created_at", "createdAt":
			s.AddField("created_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.CreatedAt = *v
		case "expires_at", "expiresAt":
			s.AddField("expires_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.ExpiresAt = *v
		}
	})
}
UnmarshalProtoJSON unmarshals the OAuthAccessToken message from JSON.
package ttnpb
import (
	gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo"
	jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin"
)
func (x *OAuthClientAuthorization) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("user_ids")
		gogo.MarshalMessage(s, &x.UserIds)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client_ids")
		gogo.MarshalMessage(s, &x.ClientIds)
	}
	if len(x.Rights) > 0 || s.HasField("rights") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("rights")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Rights {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s)
		}
		s.WriteArrayEnd()
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("created_at")
		s.WriteTime(x.CreatedAt)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("updated_at")
		s.WriteTime(x.UpdatedAt)
	}
	s.WriteObjectEnd()
}
func (x *OAuthClientAuthorization) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "user_ids", "userIds":
			s.AddField("user_ids")
			var v UserIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.UserIds = v
		case "client_ids", "clientIds":
			s.AddField("client_ids")
			var v ClientIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.ClientIds = v
		case "rights":
			s.AddField("rights")
			s.ReadArray(func() {
				var v Right
				v.UnmarshalProtoJSON(s)
				x.Rights = append(x.Rights, v)
			})
		case "created_at", "createdAt":
			s.AddField("created_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.CreatedAt = *v
		case "updated_at", "updatedAt":
			s.AddField("updated_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.UpdatedAt = *v
		}
	})
}
func (x *OAuthClientAuthorizations) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if len(x.Authorizations) > 0 || s.HasField("authorizations") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("authorizations")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Authorizations {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s.WithField("authorizations"))
		}
		s.WriteArrayEnd()
	}
	s.WriteObjectEnd()
}
func (x *OAuthClientAuthorizations) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "authorizations":
			s.AddField("authorizations")
			s.ReadArray(func() {
				if s.ReadNil() {
					x.Authorizations = append(x.Authorizations, nil)
					return
				}
				v := &OAuthClientAuthorization{}
				v.UnmarshalProtoJSON(s.WithField("authorizations", false))
				if s.Err() != nil {
					return
				}
				x.Authorizations = append(x.Authorizations, v)
			})
		}
	})
}
func (x *OAuthAuthorizationCode) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("user_ids")
		gogo.MarshalMessage(s, &x.UserIds)
	}
	if x.UserSessionId != "" || s.HasField("user_session_id") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("user_session_id")
		s.WriteString(x.UserSessionId)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client_ids")
		gogo.MarshalMessage(s, &x.ClientIds)
	}
	if len(x.Rights) > 0 || s.HasField("rights") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("rights")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Rights {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s)
		}
		s.WriteArrayEnd()
	}
	if x.Code != "" || s.HasField("code") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("code")
		s.WriteString(x.Code)
	}
	if x.RedirectUri != "" || s.HasField("redirect_uri") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("redirect_uri")
		s.WriteString(x.RedirectUri)
	}
	if x.State != "" || s.HasField("state") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("state")
		s.WriteString(x.State)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("created_at")
		s.WriteTime(x.CreatedAt)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("expires_at")
		s.WriteTime(x.ExpiresAt)
	}
	s.WriteObjectEnd()
}
func (x *OAuthAuthorizationCode) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "user_ids", "userIds":
			s.AddField("user_ids")
			var v UserIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.UserIds = v
		case "user_session_id", "userSessionId":
			s.AddField("user_session_id")
			x.UserSessionId = s.ReadString()
		case "client_ids", "clientIds":
			s.AddField("client_ids")
			var v ClientIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.ClientIds = v
		case "rights":
			s.AddField("rights")
			s.ReadArray(func() {
				var v Right
				v.UnmarshalProtoJSON(s)
				x.Rights = append(x.Rights, v)
			})
		case "code":
			s.AddField("code")
			x.Code = s.ReadString()
		case "redirect_uri", "redirectUri":
			s.AddField("redirect_uri")
			x.RedirectUri = s.ReadString()
		case "state":
			s.AddField("state")
			x.State = s.ReadString()
		case "created_at", "createdAt":
			s.AddField("created_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.CreatedAt = *v
		case "expires_at", "expiresAt":
			s.AddField("expires_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.ExpiresAt = *v
		}
	})
}
func (x *OAuthAccessToken) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("user_ids")
		gogo.MarshalMessage(s, &x.UserIds)
	}
	if x.UserSessionId != "" || s.HasField("user_session_id") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("user_session_id")
		s.WriteString(x.UserSessionId)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client_ids")
		gogo.MarshalMessage(s, &x.ClientIds)
	}
	if x.Id != "" || s.HasField("id") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("id")
		s.WriteString(x.Id)
	}
	if x.AccessToken != "" || s.HasField("access_token") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("access_token")
		s.WriteString(x.AccessToken)
	}
	if x.RefreshToken != "" || s.HasField("refresh_token") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("refresh_token")
		s.WriteString(x.RefreshToken)
	}
	if len(x.Rights) > 0 || s.HasField("rights") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("rights")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Rights {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s)
		}
		s.WriteArrayEnd()
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("created_at")
		s.WriteTime(x.CreatedAt)
	}
	if true {  
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("expires_at")
		s.WriteTime(x.ExpiresAt)
	}
	s.WriteObjectEnd()
}