// UnmarshalJSON deserializes into a ActorLogInfo instance
192921
func (u *ActorLogInfo) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// User : The user who did the action.
		User json.RawMessage `json:"user,omitempty"`
		// Admin : The admin who did the action.
		Admin json.RawMessage `json:"admin,omitempty"`
		// App : The application who did the action.
		App json.RawMessage `json:"app,omitempty"`
		// Reseller : Action done by reseller.
		Reseller json.RawMessage `json:"reseller,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 "user":
		u.User, err = IsUserLogInfoFromJSON(body)

		if err != nil {
			return err
		}
	case "admin":
		u.Admin, err = IsUserLogInfoFromJSON(body)

		if err != nil {
			return err
		}
	case "app":
		u.App, err = IsAppLogInfoFromJSON(body)

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

		if err != nil {
			return err
		}
	}
	return nil
}
289044
func (o *RouteTable) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realRouteTable
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = RouteTable(r)
	return nil
}
785739
func (s *Signature) UnmarshalJSON(b []byte) error {
	dec, err := jose.DecodeEscaped(b)
	if err != nil {
		return err
	}
	*s = Signature(dec)
	return nil
}
1160941
func (s *UUID) UnmarshalJSON(data []byte) error {
	var ss []string
	if err := json.Unmarshal(data, &ss); err != nil {
		return err
	}
	us, err := strSliceToUUIDSlice(ss)
	if err != nil {
		return errors.WithStack(err)
	}
	*s = us
	return nil
}
1158638
func (a *authorizer) UnmarshalJSON(data []byte) error {
	var cognito struct {
		Claims *map[string]string
	}
	var custom map[string]string

	err := json.Unmarshal(data, &cognito)
	if err != nil {
		return err
	}

	if cognito.Claims != nil {
		*a = authorizer(*cognito.Claims)
		return nil
	}

	err = json.Unmarshal(data, &custom)
	if err != nil {
		return err
	}

	*a = authorizer(custom)
	return nil
}
366609
func (spaceQuota *SpaceQuota) UnmarshalJSON(data []byte) error {
	var ccSpaceQuota struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name string `json:"name"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccSpaceQuota)
	if err != nil {
		return err
	}

	spaceQuota.GUID = ccSpaceQuota.Metadata.GUID
	spaceQuota.Name = ccSpaceQuota.Entity.Name
	return nil
}
128301
func (n *Node) UnmarshalJSON(raw []byte) error {
	// TODO: How should we turn back NodeInfo into n.Node?
	// Ticket: https://github.com/ethersphere/go-ethereum/issues/1177
	node := struct {
		Config *adapters.NodeConfig `json:"config,omitempty"`
		Up     bool                 `json:"up"`
	}{}
	if err := json.Unmarshal(raw, &node); err != nil {
		return err
	}

	n.SetUp(node.Up)
	n.Config = node.Config
	return nil
}
587381
func (a *Authority) UnmarshalJSON(d []byte) error {
	switch {
	case bytes.Equal(d, asAnonymousJSON):
		*a = AsAnonymous
	case bytes.Equal(d, asServiceJSON):
		*a = AsService
	case bytes.Equal(d, asUserJSON):
		*a = AsUser
	default:
		return errors.Reason("unknown authority JSON value: %v", d).Err()
	}
	return nil
}
50016
func (u *AccessMethodLogInfo) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// EndUser : End user session details.
		EndUser json.RawMessage `json:"end_user,omitempty"`
		// SignInAs : Sign in as session details.
		SignInAs json.RawMessage `json:"sign_in_as,omitempty"`
		// ContentManager : Content manager session details.
		ContentManager json.RawMessage `json:"content_manager,omitempty"`
		// AdminConsole : Admin console session details.
		AdminConsole json.RawMessage `json:"admin_console,omitempty"`
		// Api : Api session details.
		Api json.RawMessage `json:"api,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 "end_user":
		u.EndUser, err = IsSessionLogInfoFromJSON(body)

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

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

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

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

		if err != nil {
			return err
		}
	}
	return nil
}
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
}
110572
func (u *userLogInfoUnion) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// TeamMember : has no documentation (yet)
		TeamMember json.RawMessage `json:"team_member,omitempty"`
		// TrustedNonTeamMember : has no documentation (yet)
		TrustedNonTeamMember json.RawMessage `json:"trusted_non_team_member,omitempty"`
		// NonTeamMember : has no documentation (yet)
		NonTeamMember json.RawMessage `json:"non_team_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 "team_member":
		err = json.Unmarshal(body, &u.TeamMember)

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

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

		if err != nil {
			return err
		}
	}
	return nil
}
1005621
func (v *IntString) UnmarshalJSON(b []byte) error {
	var s string
	if err := json.Unmarshal(b, &s); err == nil {
		*v = IntString(s)
		return nil
	}

	var n int
	if err := json.Unmarshal(b, &n); err != nil {
		return err
	}

	*v = IntString(strconv.Itoa(n))

	return nil
}
773632
func (o *Instance) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realInstance
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = Instance(r)
	return nil
}
643448
func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		i.ID = id
		return nil
	}

	type issuingAuthorization IssuingAuthorization
	var v issuingAuthorization
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}

	*i = IssuingAuthorization(v)
	return nil
}
905062
func (im *Info) UnmarshalJSON(b []byte) error {
	type InfoAlias Info
	unencode := struct {
		InfoAlias
		CreatedAt   string `json:",omitempty"`
		LastFetched string `json:",omitempty"`
	}{}
	json.Unmarshal(b, &unencode)
	*im = Info(unencode.InfoAlias)

	var err error
	if err = decodeTime(unencode.CreatedAt, &im.CreatedAt); err == nil {
		err = decodeTime(unencode.LastFetched, &im.LastFetched)
	}
	return err
}
934852
func (p *CheckoutSession) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		p.ID = id
		return nil
	}

	type session CheckoutSession
	var v session
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}

	*p = CheckoutSession(v)
	return nil
}
192101
func (r *Result) UnmarshalJSON(data []byte) error {
	var result struct {
		MessageID      string `json:"message_id"`
		RegistrationID string `json:"registration_id"`
		Error          string `json:"error"`
	}

	if err := json.Unmarshal(data, &result); err != nil {
		return err
	}

	r.MessageID = result.MessageID
	r.RegistrationID = result.RegistrationID
	r.Error = toFirebaseErr(result.Error)

	return nil
}