func (computersystem *ComputerSystem) NetworkInterfaces() ([]*NetworkInterface, error) {
	return ListReferencedNetworkInterfaces(computersystem.Client, computersystem.networkInterfaces)
}
NetworkInterfaces returns a collection of network interfaces in this system.
package redfish
import (
	"encoding/json"
	"fmt"
	"reflect"
	"github.com/stmcginnis/gofish/common"
)
type BootOrderTypes string
const (
	BootOrderBootOrderTypes BootOrderTypes = "BootOrder"
	AliasBootOrderBootOrderTypes BootOrderTypes = "AliasBootOrder"
)
type BootSourceOverrideEnabled string
const (
	DisabledBootSourceOverrideEnabled BootSourceOverrideEnabled = "Disabled"
	OnceBootSourceOverrideEnabled BootSourceOverrideEnabled = "Once"
	ContinuousBootSourceOverrideEnabled BootSourceOverrideEnabled = "Continuous"
)
type BootSourceOverrideTarget string
const (
	NoneBootSourceOverrideTarget BootSourceOverrideTarget = "None"
	PxeBootSourceOverrideTarget BootSourceOverrideTarget = "Pxe"
	FloppyBootSourceOverrideTarget BootSourceOverrideTarget = "Floppy"
	CdBootSourceOverrideTarget BootSourceOverrideTarget = "Cd"
	UsbBootSourceOverrideTarget BootSourceOverrideTarget = "Usb"
	HddBootSourceOverrideTarget BootSourceOverrideTarget = "Hdd"
	BiosSetupBootSourceOverrideTarget BootSourceOverrideTarget = "BiosSetup"
	UtilitiesBootSourceOverrideTarget BootSourceOverrideTarget = "Utilities"
	DiagsBootSourceOverrideTarget BootSourceOverrideTarget = "Diags"
	UefiShellBootSourceOverrideTarget BootSourceOverrideTarget = "UefiShell"
	UefiTargetBootSourceOverrideTarget BootSourceOverrideTarget = "UefiTarget"
	SDCardBootSourceOverrideTarget BootSourceOverrideTarget = "SDCard"
	UefiHTTPBootSourceOverrideTarget BootSourceOverrideTarget = "UefiHttp"
	RemoteDriveBootSourceOverrideTarget BootSourceOverrideTarget = "RemoteDrive"
	UefiBootNextBootSourceOverrideTarget BootSourceOverrideTarget = "UefiBootNext"
)
type BootSourceOverrideMode string
const (
	LegacyBootSourceOverrideMode BootSourceOverrideMode = "Legacy"
	UEFIBootSourceOverrideMode BootSourceOverrideMode = "UEFI"
)
type HostingRole string
const (
	ApplicationServerHostingRole HostingRole = "ApplicationServer"
	StorageServerHostingRole HostingRole = "StorageServer"
	SwitchHostingRole HostingRole = "Switch"
)
type InterfaceType string
const (
	TPM1_2InterfaceType InterfaceType = "TPM1_2"
	TPM2_0InterfaceType InterfaceType = "TPM2_0"
	TCM1_0InterfaceType InterfaceType = "TCM1_0"
)
type InterfaceTypeSelection string
const (
	NoneInterfaceTypeSelection InterfaceTypeSelection = "None"
	FirmwareUpdateInterfaceTypeSelection InterfaceTypeSelection = "FirmwareUpdate"
	BiosSettingInterfaceTypeSelection InterfaceTypeSelection = "BiosSetting"
	OemMethodInterfaceTypeSelection InterfaceTypeSelection = "OemMethod"
)
type MemoryMirroring string
const (
	SystemMemoryMirroring MemoryMirroring = "System"
	DIMMMemoryMirroring MemoryMirroring = "DIMM"
	HybridMemoryMirroring MemoryMirroring = "Hybrid"
	NoneMemoryMirroring MemoryMirroring = "None"
)
type PowerRestorePolicyTypes string
const (
	AlwaysOnPowerRestorePolicyTypes PowerRestorePolicyTypes = "AlwaysOn"
	AlwaysOffPowerRestorePolicyTypes PowerRestorePolicyTypes = "AlwaysOff"
	LastStatePowerRestorePolicyTypes PowerRestorePolicyTypes = "LastState"
)
type PowerState string
const (
	OnPowerState PowerState = "On"
	OffPowerState PowerState = "Off"
	PoweringOnPowerState PowerState = "PoweringOn"
	PoweringOffPowerState PowerState = "PoweringOff"
)
type SystemType string
const (
	PhysicalSystemType SystemType = "Physical"
	VirtualSystemType SystemType = "Virtual"
	OSSystemType SystemType = "OS"
	PhysicallyPartitionedSystemType SystemType = "PhysicallyPartitioned"
	VirtuallyPartitionedSystemType SystemType = "VirtuallyPartitioned"
	ComposedSystemType SystemType = "Composed"
)
type WatchdogTimeoutActions string
const (
	NoneWatchdogTimeoutActions WatchdogTimeoutActions = "None"
	ResetSystemWatchdogTimeoutActions WatchdogTimeoutActions = "ResetSystem"
	PowerCycleWatchdogTimeoutActions WatchdogTimeoutActions = "PowerCycle"
	PowerDownWatchdogTimeoutActions WatchdogTimeoutActions = "PowerDown"
	OEMWatchdogTimeoutActions WatchdogTimeoutActions = "OEM"
)
type WatchdogWarningActions string
const (
	NoneWatchdogWarningActions WatchdogWarningActions = "None"
	DiagnosticInterruptWatchdogWarningActions WatchdogWarningActions = "DiagnosticInterrupt"
	SMIWatchdogWarningActions WatchdogWarningActions = "SMI"
	MessagingInterruptWatchdogWarningActions WatchdogWarningActions = "MessagingInterrupt"
	SCIWatchdogWarningActions WatchdogWarningActions = "SCI"
	OEMWatchdogWarningActions WatchdogWarningActions = "OEM"
)
type Boot struct {
	AliasBootOrder []string `json:",omitempty"`
	BootNext string `json:",omitempty"`
	bootOptions string
	BootOrder []string `json:",omitempty"`
	BootOrderPropertySelection string `json:",omitempty"`
	BootSourceOverrideEnabled BootSourceOverrideEnabled `json:",omitempty"`
	BootSourceOverrideMode BootSourceOverrideMode `json:",omitempty"`
	BootSourceOverrideTarget BootSourceOverrideTarget `json:",omitempty"`
	UefiTargetBootSourceOverride string `json:",omitempty"`
}
func (boot *Boot) UnmarshalJSON(b []byte) error {
	type temp Boot
	var t struct {
		temp
		BootOptions common.Link
	}
	err := json.Unmarshal(b, &t)
	if err != nil {
		return err
	}
	*boot = Boot(t.temp)
	boot.bootOptions = string(t.BootOptions)
	return nil
}
type ResetType string
const (
	OnResetType ResetType = "On"
	ForceOnResetType ResetType = "ForceOn"
	ForceOffResetType ResetType = "ForceOff"
	ForceRestartResetType ResetType = "ForceRestart"
	GracefulRestartResetType ResetType = "GracefulRestart"
	GracefulShutdownResetType ResetType = "GracefulShutdown"
	PushPowerButtonResetType ResetType = "PushPowerButton"
	PowerCycleResetType ResetType = "PowerCycle"
	NmiResetType ResetType = "Nmi"
)
type ComputerSystem struct {
	common.Entity
	ODataContext string `json:"@odata.context"`
	ODataType string `json:"@odata.type"`
	AssetTag string
	bios string
	BIOSVersion string `json:"BiosVersion"`
	Boot Boot
	Description string
	ethernetInterfaces string
	HostName string
	HostWatchdogTimer WatchdogTimer
	HostingRoles []string
	IndicatorLED common.IndicatorLED
	logServices string
	Manufacturer string
	memory string
	memoryDomains string
	MemorySummary MemorySummary
	Model string
	Name string
	networkInterfaces string
	pcieDevices []string
	PCIeDevicesCount int `json:"PCIeDevices@odata.count"`
	pcieFunctions []string
	PCIeFunctionsCount int `json:"PCIeFunctions@odata.count"`
	PartNumber string
	PowerRestorePolicy PowerState
	PowerState PowerState
	ProcessorSummary ProcessorSummary
	processors string
	Redundancy string
	RedundancyCount string `json:"Redundancy@odata.count"`
	SKU string
	secureBoot string
	SerialNumber string
	simpleStorage string
	Status common.Status
	storage string
	SubModel string
	SystemType SystemType
	TrustedModules []TrustedModules
	UUID string
	chassis []string
	resetTarget string
	SupportedResetTypes []ResetType
	setDefaultBootOrderTarget string
	ManagedBy []string
	rawData []byte
}
func (computersystem *ComputerSystem) UnmarshalJSON(b []byte) error {
	type CSActions struct {
		ComputerSystemReset struct {
			AllowedResetTypes []ResetType `json:"ResetType@Redfish.AllowableValues"`
			Target            string
		} `json:"#ComputerSystem.Reset"`
		SetDefaultBootOrder struct {
			Target string
		} `json:"#ComputerSystem.SetDefaultBootOrder"`
	}
	type temp ComputerSystem
	var t struct {
		temp
		Actions            CSActions
		Bios               common.Link
		Processors         common.Link
		Memory             common.Link
		EthernetInterfaces common.Link
		SimpleStorage      common.Link
		SecureBoot         common.Link
		Storage            common.Link
		NetworkInterfaces  common.Link
		LogServices        common.Link
		MemoryDomains      common.Link
		PCIeDevices        common.Links
		PCIeFunctions      common.Links
		Links              CSLinks
	}
	err := json.Unmarshal(b, &t)
	if err != nil {
		return err
	}
	*computersystem = ComputerSystem(t.temp)
	computersystem.bios = string(t.Bios)
	computersystem.processors = string(t.Processors)
	computersystem.memory = string(t.Memory)
	computersystem.ethernetInterfaces = string(t.EthernetInterfaces)
	computersystem.simpleStorage = string(t.SimpleStorage)
	computersystem.networkInterfaces = string(t.NetworkInterfaces)
	computersystem.secureBoot = string(t.SecureBoot)
	computersystem.storage = string(t.Storage)
	computersystem.logServices = string(t.LogServices)
	computersystem.memoryDomains = string(t.MemoryDomains)
	computersystem.pcieDevices = t.PCIeDevices.ToStrings()
	computersystem.pcieFunctions = t.PCIeFunctions.ToStrings()
	computersystem.chassis = t.Links.Chassis.ToStrings()
	computersystem.resetTarget = t.Actions.ComputerSystemReset.Target
	computersystem.SupportedResetTypes = t.Actions.ComputerSystemReset.AllowedResetTypes
	computersystem.setDefaultBootOrderTarget = t.Actions.SetDefaultBootOrder.Target
	computersystem.ManagedBy = t.Links.ManagedBy.ToStrings()
	computersystem.rawData = b
	return nil
}
func (computersystem *ComputerSystem) Update() error {
	cs := new(ComputerSystem)
	err := cs.UnmarshalJSON(computersystem.rawData)
	if err != nil {
		return err
	}
	readWriteFields := []string{
		"AssetTag",
		"HostName",
		"IndicatorLED",
		"PowerRestorePolicy",
	}
	originalElement := reflect.ValueOf(cs).Elem()
	currentElement := reflect.ValueOf(computersystem).Elem()
	return computersystem.Entity.Update(originalElement, currentElement, readWriteFields)
}
func GetComputerSystem(c common.Client, uri string) (*ComputerSystem, error) {
	resp, err := c.Get(uri)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var computersystem ComputerSystem
	err = json.NewDecoder(resp.Body).Decode(&computersystem)
	if err != nil {
		return nil, err
	}
	computersystem.SetClient(c)
	return &computersystem, nil
}
func ListReferencedComputerSystems(c common.Client, link string) ([]*ComputerSystem, error) {
	var result []*ComputerSystem
	links, err := common.GetCollection(c, link)
	if err != nil {
		return result, err
	}
	collectionError := common.NewCollectionError()
	for _, computersystemLink := range links.ItemLinks {
		computersystem, err := GetComputerSystem(c, computersystemLink)
		if err != nil {
			collectionError.Failures[computersystemLink] = err
		} else {
			result = append(result, computersystem)
		}
	}
	if collectionError.Empty() {
		return result, nil
	}
	return result, collectionError
}
func (computersystem *ComputerSystem) Bios() (*Bios, error) {
	if computersystem.bios == "" {
		return nil, nil
	}
	return GetBios(computersystem.Client, computersystem.bios)
}
func (computersystem *ComputerSystem) EthernetInterfaces() ([]*EthernetInterface, error) {
	return ListReferencedEthernetInterfaces(computersystem.Client, computersystem.ethernetInterfaces)
}
func (computersystem *ComputerSystem) LogServices() ([]*LogService, error) {
	return ListReferencedLogServices(computersystem.Client, computersystem.logServices)
}
func (computersystem *ComputerSystem) Memory() ([]*Memory, error) {
	return ListReferencedMemorys(computersystem.Client, computersystem.memory)
}
func (computersystem *ComputerSystem) MemoryDomains() ([]*MemoryDomain, error) {
	return ListReferencedMemoryDomains(computersystem.Client, computersystem.memoryDomains)
}