func (pa *PolicyAction) UnmarshalJSON(b []byte) error {
	raw := make([]string, 1)

	var err error
	if len(b) > 0 && b[0] == '"' {
		err = json.Unmarshal(b, &raw[0])
	} else {
		err = json.Unmarshal(b, &raw)
	}

	if err != nil {
		return err
	}

	for _, a := range raw {
		for i, v := range policyActionStrings {
			if a == v {
				*pa |= 1 << uint(i)
				continue
			}
		}
	}

	return nil
}
// UnmarshalJSON implements the json.Unmarshaler interface.
UnmarshalJSON implements the json.Unmarshaler interface.
// UnmarshalJSON implements the json . Unmarshaler interface .
func (pa *PolicyAction) UnmarshalJSON(b []byte) error {
	raw := make([]string, 1)
	var err error
	if len(b) > 0 && b[0] == '"' {
		err = json.Unmarshal(b, &raw[0])
	} else {
		err = json.Unmarshal(b, &raw)
	}
	if err != nil {
		return err
	}
	for _, a := range raw {
		for i, v := range policyActionStrings {
			if a == v {
				*pa |= 1 << uint(i)
				continue
			}
		}
	}
	return nil
}
func ( pa * PolicyAction ) UnmarshalJSON ( b [ ] byte ) error { raw := make ( [ ] string , 1 ) var err error if len ( b ) > 0 && b [ 0 ] == '"' { err = json . Unmarshal ( b , & raw [ 0 ] ) } else { err = json . Unmarshal ( b , & raw ) } if err != nil { return err } for _ , a := range raw { for i , v := range policyActionStrings { if a == v { * pa |= 1 << uint ( i ) continue } } } return nil }
UnmarshalJSON implements the json.Unmarshaler interface.
UnmarshalJSON implements the json . Unmarshaler interface .