package defsecpolicies

type SecurityPoliciesList struct {
	Policies []SecurityPolicy `json:"policies"`
}

// Main information about security policy
type SecurityPolicy struct {
	// Access group ID
	AccessGroupID string `json:"access_group_id"`

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

	// Default ACL drop behavior
	DefaultACLDrop string `json:"default_acl_drop"`

	// Default open session drop flag
	DefaultOpenSessionDrop bool `json:"default_open_session_drop"`

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

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

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

	// Security rules
	SecurityRules []SecurityRule `json:"security_rules"`

	// Locked time
	LockedAt string `json:"locked_at"`

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

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

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

// Security rule information
type SecurityRule struct {
	// Access group ID
	AccessGroupID string `json:"access_group_id"`

	// Action
	Action string `json:"action"`

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

	// Destination network object
	DestinationNetObject NetObject `json:"destination_net_object"`

	// Direction
	Direction string `json:"direction"`

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

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

	// Filter configuration
	Filter Filter `json:"filter"`

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

	// Log enabled flag
	LogEnabled bool `json:"log_enabled"`

	// Log name
	LogName string `json:"log_name"`

	// Log severity
	LogSeverity string `json:"log_severity"`

	// Priority
	Priority int `json:"priority"`

	// Security policy ID
	SecurityPolicyID string `json:"security_policy_id"`

	// Source network object
	SourceNetObject NetObject `json:"source_net_object"`

	// Statistics enabled flag
	StatisticsEnabled bool `json:"statistics_enabled"`

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

// Network object information
type NetObject struct {
	// Display name
	DisplayName string `json:"display_name"`

	// Network address pool ID
	NetAddressPoolID string `json:"net_address_pool_id"`

	// Network object group ID
	NetObjectGroupID string `json:"net_object_group_id"`
}

// Filter configuration
type Filter struct {
	// Filter parameters
	Filters FilterParams `json:"filters"`

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

// Filter parameters
type FilterParams struct {
	// All protocols flag
	All bool `json:"all"`

	// ARP protocol flag
	ARP bool `json:"arp"`

	// DHCP protocol flag
	DHCP bool `json:"dhcp"`

	// Filter expression
	Expression string `json:"expression"`

	// ICMP protocol flag
	ICMP bool `json:"icmp"`

	// IP protocol flag
	IP bool `json:"ip"`

	// IPv4 protocol flag
	IPv4 bool `json:"ip_v4"`

	// IPv6 protocol flag
	IPv6 bool `json:"ip_v6"`

	// Keep opened sessions flag
	KeepOpenedSessions bool `json:"keep_opened_sessions"`

	// ND protocol flag
	ND bool `json:"nd"`

	// TCP protocol flag
	TCP bool `json:"tcp"`

	// TCP destination ports
	TCPDstPorts []string `json:"tcp_dst_ports"`

	// UDP protocol flag
	UDP bool `json:"udp"`

	// UDP destination ports
	UDPDstPorts []string `json:"udp_dst_ports"`
}

// Status information
type Status struct {
	// Common status
	Common string `json:"common"`

	// Hypervisor statuses
	Hypervisors []HypervisorStatus `json:"hypervisors"`
}

// Hypervisor status information
type HypervisorStatus struct {
	// Status
	Status string `json:"status"`

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

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

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

	// Last sync time
	SyncedAt string `json:"synced_at"`
}
