func (filesystem *FileSystem) ExportedShares() ([]*FileShare, error) {
	return ListReferencedFileShares(filesystem.Client, filesystem.exportedShares)
}
ExportedShares gets the exported file shares for this file system.
package swordfish
import (
	"encoding/json"
	"reflect"
	"github.com/stmcginnis/gofish/common"
)
type CharacterCodeSet string
const (
	ASCIICharacterCodeSet CharacterCodeSet = "ASCII"
	UnicodeCharacterCodeSet CharacterCodeSet = "Unicode"
	ISO2022CharacterCodeSet CharacterCodeSet = "ISO2022"
	ISO88591CharacterCodeSet CharacterCodeSet = "ISO8859_1"
	ExtendedUNIXCodeCharacterCodeSet CharacterCodeSet = "ExtendedUNIXCode"
	UTF8CharacterCodeSet CharacterCodeSet = "UTF_8"
	UTF16CharacterCodeSet CharacterCodeSet = "UTF_16"
	UCS2CharacterCodeSet CharacterCodeSet = "UCS_2"
)
type FileProtocol string
const (
	NFSv3FileProtocol FileProtocol = "NFSv3"
	NFSv40FileProtocol FileProtocol = "NFSv4_0"
	NFSv41FileProtocol FileProtocol = "NFSv4_1"
	SMBv20FileProtocol FileProtocol = "SMBv2_0"
	SMBv21FileProtocol FileProtocol = "SMBv2_1"
	SMBv30FileProtocol FileProtocol = "SMBv3_0"
	SMBv302FileProtocol FileProtocol = "SMBv3_0_2"
	SMBv311FileProtocol FileProtocol = "SMBv3_1_1"
)
type FileSystemPersistenceType string
const (
	PersistentFileSystemPersistenceType FileSystemPersistenceType = "Persistent"
	TemporaryFileSystemPersistenceType FileSystemPersistenceType = "Temporary"
	OtherFileSystemPersistenceType FileSystemPersistenceType = "Other"
)
type FileSystem struct {
	common.Entity
	ODataContext string `json:"@odata.context"`
	ODataType string `json:"@odata.type"`
	AccessCapabilities []StorageAccessCapability
	BlockSizeBytes int64
	Capacity Capacity
	CapacitySources []CapacitySource
	CapacitySourcesCount int `json:"CapacitySources@odata.count"`
	CasePreserved bool
	CaseSensitive bool
	CharacterCodeSet []CharacterCodeSet
	ClusterSizeBytes int
	Description string
	Identifiers []common.Identifier
	IOStatistics IOStatistics
	LowSpaceWarningThresholdPercents []int
	MaxFileNameLengthBytes int64
	RecoverableCapacitySourceCount int
	RemainingCapacityPercent int
	ReplicaInfo ReplicaInfo
	ReplicaTargetsCount int `json:"ReplicaTargets@odata.count"`
	exportedShares string  
	replicaTargets []string
	classOfService string
	ReplicaCollectionCount int
	spareResourceSets      []string
	SpareResourceSetsCount int
	rawData []byte
}
func (filesystem *FileSystem) UnmarshalJSON(b []byte) error {
	type temp FileSystem
	type links struct {
		ClassOfService common.Link
		ReplicaCollectionCount int `json:"ReplicaCollection@odata.count"`
		SpareResourceSets common.Links
		SpareResourceSetsCount int `json:"SpareResourceSets@odata.count"`
	}
	var t struct {
		temp
		ExportedShares common.Link
		ReplicaTargets common.Links
		Links          links
	}
	err := json.Unmarshal(b, &t)
	if err != nil {
		return err
	}
	*filesystem = FileSystem(t.temp)
	filesystem.exportedShares = string(t.ExportedShares)
	filesystem.replicaTargets = t.ReplicaTargets.ToStrings()
	filesystem.classOfService = string(t.Links.ClassOfService)
	filesystem.ReplicaCollectionCount = t.Links.ReplicaCollectionCount
	filesystem.spareResourceSets = t.Links.SpareResourceSets.ToStrings()
	filesystem.SpareResourceSetsCount = t.Links.SpareResourceSetsCount
	filesystem.rawData = b
	return nil
}
func (filesystem *FileSystem) Update() error {
	original := new(FileSystem)
	err := original.UnmarshalJSON(filesystem.rawData)
	if err != nil {
		return err
	}
	readWriteFields := []string{
		"AccessCapabilities",
		"CapacitySources",
		"CasePreserved",
		"CaseSensitive",
		"CharacterCodeSet",
		"ClusterSizeBytes",
		"ExportedShares",
		"LowSpaceWarningThresholdPercents",
		"MaxFileNameLengthBytes",
		"RecoverableCapacitySourceCount",
	}
	originalElement := reflect.ValueOf(original).Elem()
	currentElement := reflect.ValueOf(filesystem).Elem()
	return filesystem.Entity.Update(originalElement, currentElement, readWriteFields)
}
func GetFileSystem(c common.Client, uri string) (*FileSystem, error) {
	resp, err := c.Get(uri)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var filesystem FileSystem
	err = json.NewDecoder(resp.Body).Decode(&filesystem)
	if err != nil {
		return nil, err
	}
	filesystem.SetClient(c)
	return &filesystem, nil
}
func ListReferencedFileSystems(c common.Client, link string) ([]*FileSystem, error) {  
	var result []*FileSystem
	if link == "" {
		return result, nil
	}
	links, err := common.GetCollection(c, link)
	if err != nil {
		return result, err
	}
	collectionError := common.NewCollectionError()
	for _, filesystemLink := range links.ItemLinks {
		filesystem, err := GetFileSystem(c, filesystemLink)
		if err != nil {
			collectionError.Failures[filesystemLink] = err
		} else {
			result = append(result, filesystem)
		}
	}
	if collectionError.Empty() {
		return result, nil
	}
	return result, collectionError
}