// UnmarshalJSON deserializes into a AddFolderMemberError instance
325402
func (u *AddFolderMemberError) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// AccessError : Unable to access shared folder.
		AccessError json.RawMessage `json:"access_error,omitempty"`
		// BadMember : `AddFolderMemberArg.members` contains a bad invitation
		// recipient.
		BadMember json.RawMessage `json:"bad_member,omitempty"`
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "access_error":
		err = json.Unmarshal(w.AccessError, &u.AccessError)

		if err != nil {
			return err
		}
	case "bad_member":
		err = json.Unmarshal(w.BadMember, &u.BadMember)

		if err != nil {
			return err
		}
	case "too_many_members":
		err = json.Unmarshal(body, &u.TooManyMembers)

		if err != nil {
			return err
		}
	case "too_many_pending_invites":
		err = json.Unmarshal(body, &u.TooManyPendingInvites)

		if err != nil {
			return err
		}
	}
	return nil
}
461090
func (u *GetSharedLinksResult) UnmarshalJSON(b []byte) error {
	type wrap struct {
		// Links : Shared links applicable to the path argument.
		Links []json.RawMessage `json:"links"`
	}
	var w wrap
	if err := json.Unmarshal(b, &w); err != nil {
		return err
	}
	u.Links = make([]IsLinkMetadata, len(w.Links))
	for i, e := range w.Links {
		v, err := IsLinkMetadataFromJSON(e)
		if err != nil {
			return err
		}
		u.Links[i] = v
	}
	return nil
}
168941
func (u *UsersSelectorArg) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// TeamMemberIds : List of member IDs.
		TeamMemberIds json.RawMessage `json:"team_member_ids,omitempty"`
		// ExternalIds : List of external user IDs.
		ExternalIds json.RawMessage `json:"external_ids,omitempty"`
		// Emails : List of email addresses.
		Emails json.RawMessage `json:"emails,omitempty"`
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "team_member_ids":
		err = json.Unmarshal(body, &u.TeamMemberIds)

		if err != nil {
			return err
		}
	case "external_ids":
		err = json.Unmarshal(body, &u.ExternalIds)

		if err != nil {
			return err
		}
	case "emails":
		err = json.Unmarshal(body, &u.Emails)

		if err != nil {
			return err
		}
	}
	return nil
}
1120272
func (self *StructTypeDef) UnmarshalJSON(b []byte) error {
	var m rawStructTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := StructTypeDef(m)
		*self = *((&o).Init())
		err = self.Validate()
	}
	return err
}
439891
func (u *HasTeamSharedDropboxValue) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "has_team_shared_dropbox":
		err = json.Unmarshal(body, &u.HasTeamSharedDropbox)

		if err != nil {
			return err
		}
	}
	return nil
}
1307080
func (u *FileErrorResult) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "file_not_found_error":
		err = json.Unmarshal(body, &u.FileNotFoundError)

		if err != nil {
			return err
		}
	case "invalid_file_action_error":
		err = json.Unmarshal(body, &u.InvalidFileActionError)

		if err != nil {
			return err
		}
	case "permission_denied_error":
		err = json.Unmarshal(body, &u.PermissionDeniedError)

		if err != nil {
			return err
		}
	}
	return nil
}
467976
func (u *ShareFolderErrorBase) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// BadPath : `ShareFolderArg.path` is invalid.
		BadPath json.RawMessage `json:"bad_path,omitempty"`
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "bad_path":
		err = json.Unmarshal(w.BadPath, &u.BadPath)

		if err != nil {
			return err
		}
	}
	return nil
}
592062
func (al *HALLinks) UnmarshalJSON(j []byte) (err error) {
	var d linkField
	if err = json.Unmarshal(j, &d); err != nil {
		return
	}

	var u *url.URL
	for linkName, value := range d {
		if u, err = url.Parse(value["href"]); err != nil {
			break
		}
		al.Add(&HALLink{
			Name: linkName,
			URL:  u,
		})
	}
	return
}
978038
func (v *ClientInfo) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(&r, v)
	return r.Error()
}
897602
func (v *Accepted) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents17(&r, v)
	return r.Error()
}
599456
func (u *MemberAddResult) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// Success : Describes a user that was successfully added to the team.
		Success json.RawMessage `json:"success,omitempty"`
	}
	var w wrap
	var err error
	if err = json.Unmarshal(body, &w); err != nil {
		return err
	}
	u.Tag = w.Tag
	switch u.Tag {
	case "success":
		err = json.Unmarshal(body, &u.Success)

		if err != nil {
			return err
		}
	case "team_license_limit":
		err = json.Unmarshal(body, &u.TeamLicenseLimit)

		if err != nil {
			return err
		}
	case "free_team_member_limit_reached":
		err = json.Unmarshal(body, &u.FreeTeamMemberLimitReached)

		if err != nil {
			return err
		}
	case "user_already_on_team":
		err = json.Unmarshal(body, &u.UserAlreadyOnTeam)

		if err != nil {
			return err
		}
	case "user_on_another_team":
		err = json.Unmarshal(body, &u.UserOnAnotherTeam)

		if err != nil {
			return err
		}
	case "user_already_paired":
		err = json.Unmarshal(body, &u.UserAlreadyPaired)

		if err != nil {
			return err
		}
	case "user_migration_failed":
		err = json.Unmarshal(body, &u.UserMigrationFailed)

		if err != nil {
			return err
		}
	case "duplicate_external_member_id":
		err = json.Unmarshal(body, &u.DuplicateExternalMemberId)

		if err != nil {
			return err
		}
	case "duplicate_member_persistent_id":
		err = json.Unmarshal(body, &u.DuplicateMemberPersistentId)

		if err != nil {
			return err
		}
	case "persistent_id_disabled":
		err = json.Unmarshal(body, &u.PersistentIdDisabled)

		if err != nil {
			return err
		}
	case "user_creation_failed":
		err = json.Unmarshal(body, &u.UserCreationFailed)

		if err != nil {
			return err
		}
	}
	return nil
}
1248948
func (h *Headers) UnmarshalJSON(data []byte) error {
	if h == nil {
		return errors.New("network.Headers: UnmarshalJSON on nil pointer")
	}
	*h = append((*h)[0:0], data...)
	return nil
}
750706
func (u *ListFolderResult) UnmarshalJSON(b []byte) error {
	type wrap struct {
		// Entries : The files and (direct) subfolders in the folder.
		Entries []json.RawMessage `json:"entries"`
		// Cursor : Pass the cursor into `listFolderContinue` to see what's
		// changed in the folder since your previous query.
		Cursor string `json:"cursor"`
		// HasMore : If true, then there are more entries available. Pass the
		// cursor to `listFolderContinue` to retrieve the rest.
		HasMore bool `json:"has_more"`
	}
	var w wrap
	if err := json.Unmarshal(b, &w); err != nil {
		return err
	}
	u.Entries = make([]IsMetadata, len(w.Entries))
	for i, e := range w.Entries {
		v, err := IsMetadataFromJSON(e)
		if err != nil {
			return err
		}
		u.Entries[i] = v
	}
	u.Cursor = w.Cursor
	u.HasMore = w.HasMore
	return nil
}
421643
func (p *SetCollectionPropertiesOptions) UnmarshalJSON(d []byte) error {
	var internal setCollectionPropertiesOptionsInternal
	if err := json.Unmarshal(d, &internal); err != nil {
		return err
	}

	p.fromInternal(&internal)
	return nil
}
91373
func (u *AppUnlinkTeamDetails) UnmarshalJSON(b []byte) error {
	type wrap struct {
		// AppInfo : Relevant application details.
		AppInfo json.RawMessage `json:"app_info"`
	}
	var w wrap
	if err := json.Unmarshal(b, &w); err != nil {
		return err
	}
	AppInfo, err := IsAppLogInfoFromJSON(w.AppInfo)
	if err != nil {
		return err
	}
	u.AppInfo = AppInfo
	return nil
}
161728
func (v *MailingListMember) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents6(&r, v)
	return r.Error()
}
217051
func (m *ExtUserObjectRef) UnmarshalJSON(raw []byte) error {
	// AO0
	var aO0 ExtUser
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.ExtUser = aO0

	return nil
}