func (x *SetClientCollaboratorRequest) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "client_ids", "clientIds":
			s.AddField("client_ids")
			var v ClientIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.ClientIds = &v
		case "collaborator":
			if !s.ReadNil() {
				x.Collaborator = &Collaborator{}
				x.Collaborator.UnmarshalProtoJSON(s.WithField("collaborator", true))
			}
		}
	})
}
UnmarshalProtoJSON unmarshals the SetClientCollaboratorRequest 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 GrantType) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	s.WriteEnumString(int32(x), GrantType_name)
}
var GrantType_customvalue = map[string]int32{
	"AUTHORIZATION_CODE": 0,
	"PASSWORD":           1,
	"REFRESH_TOKEN":      2,
}
func (x *GrantType) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	v := s.ReadEnum(GrantType_value, GrantType_customvalue)
	if err := s.Err(); err != nil {
		s.SetErrorf("could not read GrantType enum: %v", err)
		return
	}
	*x = GrantType(v)
}
func (x *Client) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.Ids != nil || s.HasField("ids") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("ids")
		gogo.MarshalMessage(s, x.Ids)
	}
	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)
	}
	if x.DeletedAt != nil || s.HasField("deleted_at") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("deleted_at")
		if x.DeletedAt == nil {
			s.WriteNil()
		} else {
			s.WriteTime(*x.DeletedAt)
		}
	}
	if x.Name != "" || s.HasField("name") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("name")
		s.WriteString(x.Name)
	}
	if x.Description != "" || s.HasField("description") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("description")
		s.WriteString(x.Description)
	}
	if x.Attributes != nil || s.HasField("attributes") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("attributes")
		s.WriteObjectStart()
		var wroteElement bool
		for k, v := range x.Attributes {
			s.WriteMoreIf(&wroteElement)
			s.WriteObjectStringField(k)
			s.WriteString(v)
		}
		s.WriteObjectEnd()
	}
	if len(x.ContactInfo) > 0 || s.HasField("contact_info") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("contact_info")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.ContactInfo {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s.WithField("contact_info"))
		}
		s.WriteArrayEnd()
	}
	if x.Secret != "" || s.HasField("secret") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("secret")
		s.WriteString(x.Secret)
	}
	if len(x.RedirectUris) > 0 || s.HasField("redirect_uris") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("redirect_uris")
		s.WriteStringArray(x.RedirectUris)
	}
	if len(x.LogoutRedirectUris) > 0 || s.HasField("logout_redirect_uris") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("logout_redirect_uris")
		s.WriteStringArray(x.LogoutRedirectUris)
	}
	if x.State != 0 || s.HasField("state") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("state")
		x.State.MarshalProtoJSON(s)
	}
	if x.StateDescription != "" || s.HasField("state_description") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("state_description")
		s.WriteString(x.StateDescription)
	}
	if x.SkipAuthorization || s.HasField("skip_authorization") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("skip_authorization")
		s.WriteBool(x.SkipAuthorization)
	}
	if x.Endorsed || s.HasField("endorsed") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("endorsed")
		s.WriteBool(x.Endorsed)
	}
	if len(x.Grants) > 0 || s.HasField("grants") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("grants")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Grants {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s)
		}
		s.WriteArrayEnd()
	}
	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()
	}
	s.WriteObjectEnd()
}
func (x *Client) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "ids":
			s.AddField("ids")
			var v ClientIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.Ids = &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
		case "deleted_at", "deletedAt":
			s.AddField("deleted_at")
			v := s.ReadTime()
			if s.Err() != nil {
				return
			}
			x.DeletedAt = v
		case "name":
			s.AddField("name")
			x.Name = s.ReadString()
		case "description":
			s.AddField("description")
			x.Description = s.ReadString()
		case "attributes":
			s.AddField("attributes")
			x.Attributes = make(map[string]string)
			s.ReadStringMap(func(key string) {
				x.Attributes[key] = s.ReadString()
			})
		case "contact_info", "contactInfo":
			s.AddField("contact_info")
			s.ReadArray(func() {
				if s.ReadNil() {
					x.ContactInfo = append(x.ContactInfo, nil)
					return
				}
				v := &ContactInfo{}
				v.UnmarshalProtoJSON(s.WithField("contact_info", false))
				if s.Err() != nil {
					return
				}
				x.ContactInfo = append(x.ContactInfo, v)
			})
		case "secret":
			s.AddField("secret")
			x.Secret = s.ReadString()
		case "redirect_uris", "redirectUris":
			s.AddField("redirect_uris")
			x.RedirectUris = s.ReadStringArray()
		case "logout_redirect_uris", "logoutRedirectUris":
			s.AddField("logout_redirect_uris")
			x.LogoutRedirectUris = s.ReadStringArray()
		case "state":
			s.AddField("state")
			x.State.UnmarshalProtoJSON(s)
		case "state_description", "stateDescription":
			s.AddField("state_description")
			x.StateDescription = s.ReadString()
		case "skip_authorization", "skipAuthorization":
			s.AddField("skip_authorization")
			x.SkipAuthorization = s.ReadBool()
		case "endorsed":
			s.AddField("endorsed")
			x.Endorsed = s.ReadBool()
		case "grants":
			s.AddField("grants")
			s.ReadArray(func() {
				var v GrantType
				v.UnmarshalProtoJSON(s)
				x.Grants = append(x.Grants, v)
			})
		case "rights":
			s.AddField("rights")
			s.ReadArray(func() {
				var v Right
				v.UnmarshalProtoJSON(s)
				x.Rights = append(x.Rights, v)
			})
		}
	})
}
func (x *Clients) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if len(x.Clients) > 0 || s.HasField("clients") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("clients")
		s.WriteArrayStart()
		var wroteElement bool
		for _, element := range x.Clients {
			s.WriteMoreIf(&wroteElement)
			element.MarshalProtoJSON(s.WithField("clients"))
		}
		s.WriteArrayEnd()
	}
	s.WriteObjectEnd()
}
func (x *Clients) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "clients":
			s.AddField("clients")
			s.ReadArray(func() {
				if s.ReadNil() {
					x.Clients = append(x.Clients, nil)
					return
				}
				v := &Client{}
				v.UnmarshalProtoJSON(s.WithField("clients", false))
				if s.Err() != nil {
					return
				}
				x.Clients = append(x.Clients, v)
			})
		}
	})
}
func (x *CreateClientRequest) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.Client != nil || s.HasField("client") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client")
		x.Client.MarshalProtoJSON(s.WithField("client"))
	}
	if x.Collaborator != nil || s.HasField("collaborator") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("collaborator")
		gogo.MarshalMessage(s, x.Collaborator)
	}
	s.WriteObjectEnd()
}
func (x *CreateClientRequest) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "client":
			if !s.ReadNil() {
				x.Client = &Client{}
				x.Client.UnmarshalProtoJSON(s.WithField("client", true))
			}
		case "collaborator":
			s.AddField("collaborator")
			var v OrganizationOrUserIdentifiers
			gogo.UnmarshalMessage(s, &v)
			x.Collaborator = &v
		}
	})
}
func (x *UpdateClientRequest) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.Client != nil || s.HasField("client") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client")
		x.Client.MarshalProtoJSON(s.WithField("client"))
	}
	if x.FieldMask != nil || s.HasField("field_mask") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("field_mask")
		if x.FieldMask == nil {
			s.WriteNil()
		} else {
			gogo.MarshalFieldMask(s, x.FieldMask)
		}
	}
	s.WriteObjectEnd()
}
func (x *UpdateClientRequest) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.ReadAny()  
		case "client":
			if !s.ReadNil() {
				x.Client = &Client{}
				x.Client.UnmarshalProtoJSON(s.WithField("client", true))
			}
		case "field_mask", "fieldMask":
			s.AddField("field_mask")
			v := gogo.UnmarshalFieldMask(s)
			if s.Err() != nil {
				return
			}
			x.FieldMask = v
		}
	})
}
func (x *SetClientCollaboratorRequest) MarshalProtoJSON(s *jsonplugin.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.ClientIds != nil || s.HasField("client_ids") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("client_ids")
		gogo.MarshalMessage(s, x.ClientIds)
	}
	if x.Collaborator != nil || s.HasField("collaborator") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("collaborator")
		x.Collaborator.MarshalProtoJSON(s.WithField("collaborator"))
	}
	s.WriteObjectEnd()
}