package logicalports

// LogicalPortsList represents a list of logical ports
type LogicalPortsList struct {
	Ports []LogicalPort `json:"ports"`
}

// Main information about logical port
type LogicalPort struct {
	// ID
	ID string `json:"id"`

	// Access group ID
	AccessGroupID string `json:"access_group_id"`

	// Access group name
	AccessGroupName string `json:"access_group_name"`

	// Adapter MAC
	AdapterMAC string `json:"adapter_mac"`

	// Address detection
	AddressDetection bool `json:"address_detection"`

	// Description
	Description string `json:"description"`

	// Created time
	CreatedAt string `json:"created_at"`

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

	// Enabled
	Enabled bool `json:"enabled"`

	// Exclude firewall information
	ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`

	// External network ID
	ExternalNetworkID string `json:"external_network_id"`

	// Hypervisor
	Hypervisor string `json:"hypervisor"`

	// Hypervisor display name
	HypervisorDisplayName string `json:"hypervisor_display_name"`

	// Labels
	Labels Labels `json:"labels"`

	// Live migration target hypervisor
	LiveMigrationTargetHV string `json:"live_migration_target_hv"`

	// Status information
	Status Status `json:"status"`

	// Bindings information
	Bindings Bindings `json:"bindings"`

	// Unique identifier
	UniqueIdentifier string `json:"unique_identifier"`

	// Updated time
	UpdatedAt string `json:"updated_at"`

	// Version ID
	VersionID uint64 `json:"version_id"`
}

// Status information
type Status struct {

	// Operation status
	OperationStatus string `json:"operation_status"`

	// Hypervisors status
	Hypervisors []HypervisorStatus `json:"hypervisors"`

	// Hypervisor status
	HypervisorStatus string `json:"hypervisor_status"`
}

// HypervisorStatus information
type HypervisorStatus struct {
	// Operation status
	OperationStatus string `json:"operation_status"`

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

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

	// Hypervisor status
	HypervisorStatus string `json:"hypervisor_status"`

	// Synced time
	SyncedAt string `json:"synced_at"`
}

// Bindings information
type Bindings struct {
	// ID
	ID string `json:"id"`

	// Segment display name
	SegmentDisplayName string `json:"segment_display_name"`

	// Segment ID
	SegmentID string `json:"segment_id"`

	// Port security
	PortSecurity bool `json:"port_security"`

	// Address detection
	AddressDetection bool `json:"address_detection"`

	// Version ID
	VersionID uint64 `json:"version_id"`

	// Created time
	CreatedAt string `json:"created_at"`

	// Updated time
	UpdatedAt string `json:"updated_at"`

	// Logical port addresses
	LogicalPortAddresses []LogicalPortAddress `json:"logical_port_addresses"`
}

// LogicalPortAddress information
type LogicalPortAddress struct {
	// IP address
	IP string `json:"ip"`

	// IP type
	IPType string `json:"ip_type"`

	// Is discovered
	IsDiscovered bool `json:"is_discovered"`

	// Is primary
	IsPrimary bool `json:"is_primary"`

	// MAC address
	MAC string `json:"mac"`

	// ID
	ID string `json:"id"`

	// Logical port ID
	LogicalPortID string `json:"logical_port_id"`

	// Assigned time
	AssignedAt string `json:"assigned_at"`
}

// Migration status information
type MigrationStatus struct {
	// ID
	ID string `json:"id"`

	// Version ID
	VersionID uint64 `json:"version_id"`
}

// ExcludeFirewall information
type ExcludeFirewall struct {
	// Exclusion reason
	ExclusionReason string `json:"exclusion_reason"`

	// Whether logical port addresses are excluded from firewall
	LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`

	// Whether logical port is excluded from firewall
	LogicalPortExcluded bool `json:"logical_port_excluded"`
}

// Labels information
type Labels struct {
	// VM ID
	VMID string `json:"vm_id"`

	// VM name
	VMName string `json:"vm_name"`
}

// Information about a version
type RecordVersion struct {
	// Version ID
	VersionID uint64 `json:"version_id"`
}
