func (l Links) ToStrings() []string {
	var result []string
	for _, link := range l {
		result = append(result, string(link))
	}
	return result
}
ToStrings converts a Link collection to a list of strings
package common
import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"reflect"
)
const DefaultServiceRoot = "/redfish/v1/"
type Client interface {
	Get(url string) (*http.Response, error)
	GetWithHeaders(url string, customHeaders map[string]string) (*http.Response, error)
	Post(url string, payload interface{}) (*http.Response, error)
	PostWithHeaders(url string, payload interface{}, customHeaders map[string]string) (*http.Response, error)
	PostMultipart(url string, payload map[string]io.Reader) (*http.Response, error)
	PostMultipartWithHeaders(url string, payload map[string]io.Reader, customHeaders map[string]string) (*http.Response, error)
	Patch(url string, payload interface{}) (*http.Response, error)
	PatchWithHeaders(url string, payload interface{}, customHeaders map[string]string) (*http.Response, error)
	Put(url string, payload interface{}) (*http.Response, error)
	PutWithHeaders(url string, payload interface{}, customHeaders map[string]string) (*http.Response, error)
	Delete(url string) (*http.Response, error)
	DeleteWithHeaders(url string, customHeaders map[string]string) (*http.Response, error)
}
type Entity struct {
	ODataID string `json:"@odata.id"`
	ID string `json:"Id"`
	Name string `json:"Name"`
	Client Client
}
func (e *Entity) SetClient(c Client) {
	e.Client = c
}
func (e *Entity) Update(originalEntity, currentEntity reflect.Value, allowedUpdates []string) error {
	payload := make(map[string]interface{})
	for i := 0; i < originalEntity.NumField(); i++ {
		if !originalEntity.Field(i).CanInterface() {
			continue
		}
		fieldType := originalEntity.Type().Field(i).Type.Kind()
		if fieldType == reflect.Struct || fieldType == reflect.Ptr || fieldType == reflect.Slice {
			continue
		}
		fieldName := originalEntity.Type().Field(i).Name
		jsonName := originalEntity.Type().Field(i).Tag.Get("json")
		if jsonName != "" {
			fieldName = jsonName
		}
		originalValue := originalEntity.Field(i).Interface()
		currentValue := currentEntity.Field(i).Interface()
		if originalValue == nil && currentValue == nil {
			continue
		} else if originalValue == nil {
			payload[fieldName] = currentValue
		} else if reflect.TypeOf(originalValue).Kind() != reflect.Map {
			if originalValue != currentValue {
				payload[fieldName] = currentValue
			}
		} else if !reflect.DeepEqual(originalValue, currentValue) {
			payload[fieldName] = currentValue
		}
	}
	for field := range payload {
		found := false
		for _, name := range allowedUpdates {
			if name == field {
				found = true
				break
			}
		}
		if !found {
			return fmt.Errorf("%s field is read only", field)
		}
	}
	if len(payload) > 0 {
		_, err := e.Client.Patch(e.ODataID, payload)  
		if err != nil {
			return err
		}
	}
	return nil
}
type Link string
func (l *Link) UnmarshalJSON(b []byte) error {
	var t struct {
		ODataID string `json:"@odata.id"`
		Href    string `json:"href"`
	}
	err := json.Unmarshal(b, &t)
	if err != nil {
		*l = ""
	}
	*l = Link(t.ODataID)
	if *l == "" {
		*l = Link(t.Href)
	}
	return nil
}
type Links []Link