// UnmarshalJSON deserializes into a UsersSelectorArg instance
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
}
32700
func (b *PolicyBindings) UnmarshalJSON(data []byte) error {
	bindings := []roleBinding{}
	if err := json.Unmarshal(data, &bindings); err != nil {
		return err
	}
	newOne := make(PolicyBindings, len(bindings))
	for _, item := range bindings {
		members := make(membersSet, len(item.Members))
		for _, member := range item.Members {
			members[member] = struct{}{}
		}
		newOne[item.Role] = members
	}
	*b = newOne
	return nil
}
135845
func (v *BodySendFormatV2) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson3b0ebf6aDecodeGithubComSignalfxGatewayProtocolSignalfxFormat7(&r, v)
	return r.Error()
}
405790
func (o *SnippetEllipsisTextOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		o.value = newDefaultSnippetEllipsisTextValue
		return nil
	}
	return json.Unmarshal(data, &o.value)
}
388182
func (us *UnreachableStrategy) UnmarshalJSON(b []byte) error {
	var u unreachableStrategy
	var errEnabledUS, errNonEnabledUS error
	if errEnabledUS = json.Unmarshal(b, &u); errEnabledUS == nil {
		*us = UnreachableStrategy(u)
		return nil
	}

	if errNonEnabledUS = json.Unmarshal(b, &us.AbsenceReason); errNonEnabledUS == nil {
		return nil
	}

	return fmt.Errorf("failed to unmarshal unreachable strategy: unmarshaling into enabled returned error '%s'; unmarshaling into non-enabled returned error '%s'", errEnabledUS, errNonEnabledUS)
}
320744
func (u *GroupsSelector) UnmarshalJSON(body []byte) error {
	type wrap struct {
		dropbox.Tagged
		// GroupIds : List of group IDs.
		GroupIds json.RawMessage `json:"group_ids,omitempty"`
		// GroupExternalIds : List of external IDs of groups.
		GroupExternalIds json.RawMessage `json:"group_external_ids,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 "group_ids":
		err = json.Unmarshal(body, &u.GroupIds)

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

		if err != nil {
			return err
		}
	}
	return nil
}
629694
func (u *AddMemberSelectorError) 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 "invalid_dropbox_id":
		err = json.Unmarshal(body, &u.InvalidDropboxId)

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

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

		if err != nil {
			return err
		}
	}
	return nil
}
209612
func (v *App) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson633f8c25DecodeGithubComCloudfoundryCommunityFirehoseToSyslogCaching(&r, v)
	return r.Error()
}
557348
func (routeMapping *RouteMapping) UnmarshalJSON(data []byte) error {
	var ccRouteMapping struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			AppGUID   string `json:"app_guid"`
			RouteGUID string `json:"route_guid"`
		} `json:"entity"`
	}

	err := cloudcontroller.DecodeJSON(data, &ccRouteMapping)
	if err != nil {
		return err
	}

	routeMapping.GUID = ccRouteMapping.Metadata.GUID
	routeMapping.AppGUID = ccRouteMapping.Entity.AppGUID
	routeMapping.RouteGUID = ccRouteMapping.Entity.RouteGUID
	return nil
}
1306083
func (v *CBPerson) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks1(&r, v)
	return r.Error()
}
488706
func (o *ResourceHolder) UnmarshalJSON(data []byte) error {
	var jsonName string
	err := json.Unmarshal(data, &jsonName)
	if err != nil {
		return err
	}
	o.Name = jsonName
	return nil
}
283012
func (v *CBGithub) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks4(&r, v)
	return r.Error()
}
1310138
func (v *bulkDeleteRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson8092efb6DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
1121301
func (f *SelectFunc) UnmarshalJSON(data []byte) error {
	v := struct {
		FnSelect []json.RawMessage `json:"Fn::Select"`
	}{}
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	if len(v.FnSelect) != 2 {
		return &json.UnsupportedValueError{Str: string(data)}
	}
	// Possible that the second arg is another template, in which case
	// we need to check for that...Example:
	/*
		"Fn::Select": [
				0,
				{
						"Fn::GetAtt": [
								"ApplicationLoadBalancer",
								"SecurityGroups"
						]
				}
		]
	*/
	var positionSelector interface{}
	if err := json.Unmarshal(v.FnSelect[0], &positionSelector); err != nil {
		return err
	}
	// If it's an integer or boolean, there's an issue
	switch positionSelector.(type) {
	case bool, int:
		return &json.UnsupportedValueError{Str: fmt.Sprintf("%v", positionSelector)}
	}
	f.Selector = fmt.Sprintf("%v", positionSelector)

	// What about the second one?
	if err := json.Unmarshal(v.FnSelect[1], &f.Items); err != nil {
		return err
	}

	return nil
}
357591
func (c *ConfigPolicyNode) UnmarshalJSON(data []byte) error {
	m := map[string]interface{}{}
	decoder := json.NewDecoder(bytes.NewReader(data))
	if err := decoder.Decode(&m); err != nil {
		return err
	}
	if rs, ok := m["rules"]; ok {
		if rules, ok := rs.(map[string]interface{}); ok {
			addRulesToConfigPolicyNode(rules, c)
		}
	}
	return nil
}
418449
func (o *MirrorKeystore) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realMirrorKeystore
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = MirrorKeystore(r)
	return nil
}
389442
func (e *EphemeralKey) UnmarshalJSON(data []byte) error {
	type ephemeralKey EphemeralKey
	var ee ephemeralKey
	err := json.Unmarshal(data, &ee)
	if err == nil {
		*e = EphemeralKey(ee)
	}

	e.RawJSON = data

	return nil
}