package account

// Access Control List
type ListRecordACL struct {
	// Whether access is explicitly specified
	IsExplicit bool `json:"explicit"`

	// GUID
	GUID string `json:"guid"`

	// Access rights
	Rights string `json:"right"`

	// Status
	Status string `json:"status"`

	// Account Type
	Type string `json:"type"`

	// Account owner ID
	UgroupID string `json:"userGroupId"`
}

// Access Control List
type RecordACL struct {
	// Emails
	Emails []string `json:"emails"`

	// Whether access is explicitly specified
	IsExplicit bool `json:"explicit"`

	// GUID
	GUID string `json:"guid"`

	// Access rights
	Rights string `json:"right"`

	// Status
	Status string `json:"status"`

	// Account Type
	Type string `json:"type"`

	// Account owner ID
	UgroupID string `json:"userGroupId"`

	// Is it possible to remove
	CanBeDeleted bool `json:"canBeDeleted"`
}

// Resource limits
type ResourceLimits struct {
	// Number of cores
	CUC float64 `json:"CU_C"`

	// Disk size, GB
	CUD float64 `json:"CU_D"`

	// Max disk size, GB
	CUDM float64 `json:"CU_DM"`

	// Number of public IP addresses
	CUI float64 `json:"CU_I"`

	// RAM size, MB
	CUM float64 `json:"CU_M"`

	// Number of graphics cores
	GPUUnits float64 `json:"gpu_units"`

	// Storage policy
	StoragePolicy []StoragePolicyItem `json:"storage_policy"`
}

type StoragePolicyItem struct {
	ID uint64 `json:"id"`

	Limit int `json:"limit"`
}

// Main information in one of if the list of accounts
type ItemAccount struct {
	// Access Control List
	ACL []ListRecordACL `json:"acl"`

	// Compute Features
	ComputeFeatures []string `json:"computeFeatures"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Description
	Description string `json:"desc"`

	// ID
	ID uint64 `json:"id"`

	// Name
	Name string `json:"name"`

	// Status
	Status string `json:"status"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`

	// Zones
	ZoneIDs []uint64 `json:"zoneIds"`
}

// List of accounts
type ListAccounts struct {
	Data []ItemAccount `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

// Policy
type Policy struct {
	// Size of the disk
	DiskSize float64 `json:"disksize"`

	// Max size of the disk
	DiskSizeMax float64 `json:"disksizemax"`

	// SEPs used
	SEPs map[string]map[string]DiskUsage `json:"seps"`
}

// Resources used
type Resource struct {
	// Number of cores
	CPU int64 `json:"cpu"`

	// Disk size
	DiskSize float64 `json:"disksize"`

	// Max disk size
	DiskSizeMax float64 `json:"disksizemax"`

	// Number of External IPs
	ExtIPs int64 `json:"extips"`

	// Number of grafic cores
	GPU int64 `json:"gpu"`

	// Policies
	Policies map[string]Policy `json:"policies"`

	// Number of RAM
	RAM int64 `json:"ram"`

	// SEPs
	SEPs map[string]map[string]DiskUsage `json:"seps"`
}

// Disk usage
type DiskUsage struct {
	// Disk size
	DiskSize float64 `json:"disksize"`

	// Disk size max
	DiskSizeMax float64 `json:"disksizemax"`
}

// Information about resource consumption
type RecordResourceConsumption struct {
	ItemResourceConsumption

	// Resource limits
	ResourceLimits ResourceLimits `json:"resourceLimits"`
}

// Information about resources
type ItemResourceConsumption struct {
	// Current information about resources
	Consumed Resource `json:"consumed"`

	// Reserved information about resources
	Reserved Resource `json:"reserved"`

	// Account ID
	AccountID uint64 `json:"id"`
}

type ListResourceConsumption struct {
	Data []ItemResourceConsumption `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

// Information about computes
type Computes struct {
	// Number of starting computes
	Starting uint64 `json:"STARTING"`

	// Number of started computes
	Started uint64 `json:"STARTED"`

	// Number of stopping computes
	Stopping uint64 `json:"STOPPING"`

	// Number of stopped computes
	Stopped uint64 `json:"STOPPED"`

	// Number of paused computes
	Paused uint64 `json:"PAUSED"`

	// Number of pausing computes
	Pausing uint64 `json:"PAUSING"`

	// Number of merging computes
	Merge uint64 `json:"MERGE"`

	// Number of migrating computes
	Migrating uint64 `json:"MIGRATING"`

	// Number of computes migrating in
	MigratingIn uint64 `json:"MIGRATING_IN"`

	// Number of computes migrating out
	MigratingOut uint64 `json:"MIGRATING_OUT"`

	// Number of computes in down status
	Down uint64 `json:"DOWN"`

	// Number of scheduled computes
	Scheduled uint64 `json:"SCHEDULED"`

	// Number of computes with stopped backup
	BackupStopped uint64 `json:"BACKUP_STOPPED"`

	// Number of computes with running backup
	BackupRunning uint64 `json:"BACKUP_RUNNING"`

	// Number of computes creating a snapshot
	Snapcreate uint64 `json:"SNAPCREATE"`

	// Number of cloning computes
	Cloning uint64 `json:"CLONING"`

	// Number of computes being rolled back
	Rollback uint64 `json:"ROLLBACK"`
}

// Information about machines
type Machines struct {
	// Number of running machines
	Running uint64 `json:"running"`

	// Number of halted machines
	Halted uint64 `json:"halted"`
}

// Detailed information about the account zone
type ZoneID struct {
	// ID of zone
	ID int64 `json:"id"`

	// Name of zone
	Name string `json:"name"`
}

// Main information about account
type RecordAccount struct {
	// DCLocation
	DCLocation string `json:"DCLocation"`

	// Access control list
	ACL []RecordACL `json:"acl"`

	// Company
	Company string `json:"company"`

	// Company URL
	CompanyURL string `json:"companyurl"`

	// Compute Features
	ComputeFeatures []string `json:"computeFeatures"`

	// Computes
	Computes Computes `json:"computes"`

	// CPU allocation parameter
	CPUAllocationParameter string `json:"cpu_allocation_parameter"`

	// CPU allocation ratio
	CPUAllocationRatio uint64 `json:"cpu_allocation_ratio"`

	// Created by
	CreatedBy string `json:"createdBy"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Description
	Description string `json:"desc"`

	// Deactivation time
	DeactivationTime float64 `json:"deactivationTime"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Display name
	DisplayName string `json:"displayname"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Machines
	Machines Machines `json:"machines"`

	// Name
	Name string `json:"name"`

	// Resource limits
	ResourceLimits ResourceLimits `json:"resourceLimits"`

	// Resource types
	ResTypes []string `json:"resourceTypes"`

	// Send access emails
	SendAccessEmails bool `json:"sendAccessEmails"`

	// Status
	Status string `json:"status"`

	// Storage policy ids
	StoragePolicyIDs []uint64 `json:"storage_policy_ids"`

	// UniqPools
	UniqPools []interface{} `json:"uniqPools"`

	// Updated By
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`

	// Version
	Version uint64 `json:"version"`

	// VINS
	VINS []uint64 `json:"vins"`

	// VINSes
	VINSes uint64 `json:"vinses"`

	// Zone
	ZoneIDs []ZoneID `json:"zoneIds"`

	// Zones
	DefaultZoneID uint64 `json:"defaultZoneId"`
}

// Main information about compute
type ItemCompute struct {
	// ID an account
	AccountID uint64 `json:"accountId"`

	// Account name
	AccountName string `json:"accountName"`

	// Number of CPU
	CPUs uint64 `json:"cpus"`

	// Created by
	CreatedBy string `json:"createdBy"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// ID compute
	ComputeID uint64 `json:"id"`

	// Compute name
	ComputeName string `json:"name"`

	// Number of RAM
	RAM uint64 `json:"ram"`

	// Registered or not
	Registered bool `json:"registered"`

	// Resource group ID
	RGID uint64 `json:"rgId"`

	// Resource group Name
	RGName string `json:"rgName"`

	// Status
	Status string `json:"status"`

	// Tech status
	TechStatus string `json:"techStatus"`

	// Total disks size
	TotalDisksSize uint64 `json:"totalDisksSize"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`

	// User controlled or not
	UserManaged bool `json:"userManaged"`

	// Number of connected VINS
	VINSConnected uint64 `json:"vinsConnected"`
}

// List of computes
type ListComputes struct {
	// Data
	Data []ItemCompute `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

// Main information about disk
type ItemDisk struct {
	// ID
	ID uint64 `json:"id"`

	// Name
	Name string `json:"name"`

	// Pool
	Pool string `json:"pool"`

	// ID SEP
	SEPID uint64 `json:"sepId"`

	// Shareable
	Shareable bool `json:"shareable"`

	// Max size
	SizeMax uint64 `json:"sizeMax"`

	// Disk type
	Type string `json:"type"`
}

// List of disks
type ListDisks struct {
	// Data
	Data []ItemDisk `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

// Main information about VINS
type ItemVINS struct {
	// Account ID
	AccountID uint64 `json:"accountId"`

	// Name of account
	AccountName string `json:"accountName"`

	// Number of computes
	Computes uint64 `json:"computes"`

	// Created by
	CreatedBy string `json:"createdBy"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Enable Default Gateway
	EnableDefaultGateway bool `json:"enable_default_gateway"`

	// External IP
	ExternalIP string `json:"externalIP"`

	// Extnet ID
	ExtnetId uint64 `json:"extnetId"`

	// Free IPs
	FreeIPs int64 `json:"freeIPs"`

	// ID
	ID uint64 `json:"id"`

	// Name
	Name string `json:"name"`

	// Network
	Network string `json:"network"`

	// NNFDev ID
	PriVNFDevID uint64 `json:"priVnfDevId"`

	// Resource group ID
	RGID uint64 `json:"rgId"`

	// Resource group name
	RGName string `json:"rgName"`

	// Status
	Status string `json:"status"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`
}

// List of VINS
type ListVINS struct {
	// Data
	Data []ItemVINS `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

// Main info about audit
type ItemAudit struct {
	// Call
	Call string `json:"call"`

	// Response time
	ResponseTime float64 `json:"responsetime"`

	// Status code
	StatusCode uint64 `json:"statuscode"`

	// Timestamp
	Timestamp float64 `json:"timestamp"`

	// User
	User string `json:"user"`
}

// List of audits
type ListAudits []ItemAudit

// Information compute in resource group
type RGComputes struct {
	// Number of starting computes
	Starting uint64 `json:"STARTING"`

	// Number of started computes
	Started uint64 `json:"STARTED"`

	// Number of stopping computes
	Stopping uint64 `json:"STOPPING"`

	// Number of stopped computes
	Stopped uint64 `json:"STOPPED"`

	// Number of paused computes
	Paused uint64 `json:"PAUSED"`

	// Number of pausing computes
	Pausing uint64 `json:"PAUSING"`

	// Number of merging computes
	Merge uint64 `json:"MERGE"`

	// Number of migrating computes
	Migrating uint64 `json:"MIGRATING"`

	// Number of computes migrating in
	MigratingIn uint64 `json:"MIGRATING_IN"`

	// Number of computes migrating out
	MigratingOut uint64 `json:"MIGRATING_OUT"`

	// Number of computes in down status
	Down uint64 `json:"DOWN"`

	// Number of scheduled computes
	Scheduled uint64 `json:"SCHEDULED"`

	// Number of computes with stopped backup
	BackupStopped uint64 `json:"BACKUP_STOPPED"`

	// Number of computes with running backup
	BackupRunning uint64 `json:"BACKUP_RUNNING"`

	// Number of computes creating a snapshot
	Snapcreate uint64 `json:"SNAPCREATE"`

	// Number of cloning computes
	Cloning uint64 `json:"CLONING"`

	// Number of computes being rolled back
	Rollback uint64 `json:"ROLLBACK"`
}

// Resources of Resource group
type RGResources struct {
	// Consumed
	Consumed Resource `json:"Consumed"`

	// Limits
	Limits LimitsRG `json:"Limits"`

	// Reserved
	Reserved Resource `json:"Reserved"`
}

// Resources used
type LimitsRG struct {
	// Number of cores
	CPU int64 `json:"cpu"`

	// Disk size
	DiskSize int64 `json:"disksize"`

	// Max disk size
	DiskSizeMax int64 `json:"disksizemax"`

	// Number of External IPs
	ExtIPs int64 `json:"extips"`

	// Number of grafic cores
	GPU int64 `json:"gpu"`

	// Number of RAM
	RAM int64 `json:"ram"`

	// SEPs
	SEPs uint64 `json:"seps"`

	// Policies
	Policies map[string]Policy `json:"policies"`
}

// Main information about resource group
type ItemRG struct {
	// Computes
	Computes RGComputes `json:"Computes"`

	// Resources
	Resources RGResources `json:"Resources"`

	// Created by
	CreatedBy string `json:"createdBy"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Description
	Description string `json:"desc"`

	// Resource group ID
	RGID uint64 `json:"id"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Resource group name
	RGName string `json:"name"`

	// Status
	Status string `json:"status"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`

	// Number of VINS
	VINSes uint64 `json:"vinses"`
}

// List of Resource groups
type ListRG struct {
	// Data
	Data []ItemRG `json:"data"`

	// Enrtry count
	EntryCount uint64 `json:"entryCount"`
}

// Main information about template
type ItemTemplate struct {
	// UNCPath
	UNCPath string `json:"UNCPath"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Description
	Description string `json:"desc"`

	// ID
	ID uint64 `json:"id"`

	// Name
	Name string `json:"name"`

	// Public or not
	Public bool `json:"public"`

	// Size
	Size uint64 `json:"size"`

	// Status
	Status string `json:"status"`

	// Type
	Type string `json:"type"`

	// Username
	Username string `json:"username"`
}

// List of templates
type ListTemplates struct {
	// Data
	Data []ItemTemplate `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

// Main information about FLIPGroup
type ItemFLIPGroup struct {
	// Account ID
	AccountID uint64 `json:"accountId"`

	// Client type
	ClientType string `json:"clientType"`

	// Connection type
	ConnType string `json:"connType"`

	// Created by
	CreatedBy string `json:"createdBy"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Default GW
	DefaultGW string `json:"defaultGW"`

	// Deleted by
	DeletedBy string `json:"deletedBy"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Description
	Description string `json:"desc"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// IP
	IP string `json:"ip"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	// Network ID
	NetID uint64 `json:"netId"`

	// Network type
	NetType string `json:"netType"`

	// Network mask
	NetMask uint64 `json:"netmask"`

	// Status
	Status string `json:"status"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`
}

// List of FLIPGroups
type ListFLIPGroups struct {
	// Data
	Data []ItemFLIPGroup `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}
