package account

// 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

type RecordResourceConsumption struct {
	ItemResourceConsumption

	ResourceLimits ResourceLimits `json:"resourceLimits"`
}

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

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

	// ID of account
	AccountID uint64 `json:"id"`
}

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

	// Entry count
	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"`
}

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

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

	// Disk size max
	DiskSizeMax float64 `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 map[string]map[string]DiskUsage `json:"seps"`

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

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

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

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

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

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

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

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

	// User group ID
	UserGroupID string `json:"userGroupId"`
}

// Access Control List with emails field
type ACLWithEmails struct {
	// ACL
	ACL

	// Emails
	Emails []string `json:"emails"`
}

// Resource limits
type ResourceLimits struct {
	// CuC
	CuC float64 `json:"CU_C"`

	// CuD
	CuD float64 `json:"CU_D"`

	// CuDM
	CuDM float64 `json:"CU_DM"`

	// CuI
	CuI float64 `json:"CU_I"`

	// CuM
	CuM float64 `json:"CU_M"`

	// GPUUnits
	GPUUnits float64 `json:"gpu_units"`

	// Storage policies
	StoragePolicies []StoragePolicy `json:"storage_policy"`
}

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

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

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

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

	// 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"`

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

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

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

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

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

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

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

	// 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 []string `json:"uniqPools"`

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

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

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

	// List of VINS IDs
	VINS []uint64 `json:"vins"`

	// Default zone ID
	DefaultZoneID uint64 `json:"defaultZoneId"`
}

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

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

// Deatailed information about account
type RecordAccount struct {
	// Main information about account
	InfoAccount

	// Access Control List
	ACL []ACLWithEmails `json:"acl"`

	// Zones IDs
	ZoneIDs []ZoneID `json:"zoneIds"`
}

// More information about account
type ItemAccount struct {

	// Access Control List
	ACL []ACL `json:"acl"`

	// Main information about account
	InfoAccount

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

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

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

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

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

// Main information about compute
type ItemCompute struct {
	// Account ID
	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
	ID uint64 `json:"id"`

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

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

	// Registered
	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 managed
	UserManaged bool `json:"userManaged"`

	// VINS Connected
	VINSConnected uint64 `json:"vinsConnected"`
}

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

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

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

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

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

	// SepID
	SepID uint64 `json:"sepId"`

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

	// Size max
	SizeMax uint64 `json:"sizeMax"`

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

// List of FLIPGroups
type ListFLIPGroups struct {
	// Data
	Data []ItemFLIPGroup `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"`
}

// Computes info
type Computes struct {
	// Starting
	Starting uint64 `json:"STARTING"`

	// Started
	Started uint64 `json:"STARTED"`

	// Stopping
	Stopping uint64 `json:"STOPPING"`

	// Stopped
	Stopped uint64 `json:"STOPPED"`

	// Paused
	Paused uint64 `json:"PAUSED"`

	// Pausing
	Pausing uint64 `json:"PAUSING"`

	// Merge
	Merge uint64 `json:"MERGE"`

	// Migrating
	Migrating uint64 `json:"MIGRATING"`

	// Migrating in
	MigratingIn uint64 `json:"MIGRATING_IN"`

	// Migrating out
	MigratingOut uint64 `json:"MIGRATING_OUT"`

	// Down
	Down uint64 `json:"DOWN"`

	// Scheduled
	Scheduled uint64 `json:"SCHEDULED"`

	// Backup stopped
	BackupStopped uint64 `json:"BACKUP_STOPPED"`

	// Backup running
	BackupRunning uint64 `json:"BACKUP_RUNNING"`

	// Snapcreate
	Snapcreate uint64 `json:"SNAPCREATE"`

	// Cloning
	Cloning uint64 `json:"CLONING"`

	// Rollback
	Rollback uint64 `json:"ROLLBACK"`
}

// Limits
type Limits struct {
	// Number of CPU
	CPU int64 `json:"cpu"`

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

	// Disk size max
	DiskSizeMax int64 `json:"disksizemax"`

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

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

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

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

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

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

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

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

// Main information about Resource group
type ItemRG struct {
	// Compute
	Computes Computes `json:"Computes"`

	// Resources of resource group
	Resources RGResuorces `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"`

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

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

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

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

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

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

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

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

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

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

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

	// 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"`

	// PriVNFDevID
	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 VINSes
type ListVINS struct {
	//Data
	Data []ItemVINS `json:"data"`

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