func ListReferencedRoles(c common.Client, link string) ([]*Role, error) {  
	var result []*Role
	if link == "" {
		return result, nil
	}
	links, err := common.GetCollection(c, link)
	if err != nil {
		return result, err
	}
	collectionError := common.NewCollectionError()
	for _, roleLink := range links.ItemLinks {
		role, err := GetRole(c, roleLink)
		if err != nil {
			collectionError.Failures[roleLink] = err
		} else {
			result = append(result, role)
		}
	}
	if collectionError.Empty() {
		return result, nil
	}
	return result, collectionError
}
ListReferencedRoles gets the collection of Role from
a provided reference.
package redfish
import (
	"encoding/json"
	"reflect"
	"github.com/stmcginnis/gofish/common"
)
type PrivilegeType string
const (
	LoginPrivilegeType PrivilegeType = "Login"
	ConfigureManagerPrivilegeType PrivilegeType = "ConfigureManager"
	ConfigureUsersPrivilegeType PrivilegeType = "ConfigureUsers"
	ConfigureSelfPrivilegeType PrivilegeType = "ConfigureSelf"
	ConfigureComponentsPrivilegeType PrivilegeType = "ConfigureComponents"
	NoAuthPrivilegeType PrivilegeType = "NoAuth"
)
type Role struct {
	common.Entity
	ODataContext string `json:"@odata.context"`
	ODataType string `json:"@odata.type"`
	AssignedPrivileges []PrivilegeType
	Description string
	IsPredefined bool
	OemPrivileges []string
	RoleID string `json:"RoleId"`
	rawData []byte
}
func (role *Role) UnmarshalJSON(b []byte) error {
	type temp Role
	var t struct {
		temp
	}
	err := json.Unmarshal(b, &t)
	if err != nil {
		return err
	}
	*role = Role(t.temp)
	role.rawData = b
	return nil
}
func (role *Role) Update() error {
	original := new(Role)
	err := original.UnmarshalJSON(role.rawData)
	if err != nil {
		return err
	}
	readWriteFields := []string{
		"AssignedPrivileges",
		"OemPrivileges",
	}
	originalElement := reflect.ValueOf(original).Elem()
	currentElement := reflect.ValueOf(role).Elem()
	return role.Entity.Update(originalElement, currentElement, readWriteFields)
}
func GetRole(c common.Client, uri string) (*Role, error) {
	resp, err := c.Get(uri)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var role Role
	err = json.NewDecoder(resp.Body).Decode(&role)
	if err != nil {
		return nil, err
	}
	role.SetClient(c)
	return &role, nil
}