package lbs

import (
	"github.com/mitchellh/mapstructure"

	"github.com/rackspace/gophercloud"
	"github.com/rackspace/gophercloud/pagination"
	"github.com/rackspace/gophercloud/rackspace/lb/v1/nodes"
	"github.com/rackspace/gophercloud/rackspace/lb/v1/vips"
)

// Protocol represents the network protocol which the load balancer accepts.
type Protocol struct {
	// The name of the protocol, e.g. HTTP, LDAP, FTP, etc.
	Name string

	// The port number for the protocol.
	Port int
}

// Algorithm defines how traffic should be directed between back-end nodes.
type Algorithm string

const (
	// LC directs traffic to the node with the lowest number of connections.
	LC = "LEAST_CONNECTIONS"

	// RAND directs traffic to nodes at random.
	RAND = "RANDOM"

	// RR directs traffic to each of the nodes in turn.
	RR = "ROUND_ROBIN"

	// WLC directs traffic to a node based on the number of concurrent
	// connections and its weight.
	WLC = "WEIGHTED_LEAST_CONNECTIONS"

	// WRR directs traffic to a node according to the RR algorithm, but with
	// different proportions of traffic being directed to the back-end nodes.
	// Weights must be defined as part of the node configuration.
	WRR = "WEIGHTED_ROUND_ROBIN"
)

// Status represents the potential state of a load balancer resource.
type Status string

const (
	// ACTIVE indicates that the LB is configured properly and ready to serve
	// traffic to incoming requests via the configured virtual IPs.
	ACTIVE = "ACTIVE"

	// BUILD indicates that the LB is being provisioned for the first time and
	// configuration is being applied to bring the service online. The service
	// cannot yet serve incoming requests.
	BUILD = "BUILD"

	// PENDINGUPDATE indicates that the LB is online but configuration changes
	// are being applied to update the service based on a previous request.
	PENDINGUPDATE = "PENDING_UPDATE"

	// PENDINGDELETE indicates that the LB is online but configuration changes
	// are being applied to begin deletion of the service based on a previous
	// request.
	PENDINGDELETE = "PENDING_DELETE"

	// SUSPENDED indicates that the LB has been taken offline and disabled.
	SUSPENDED = "SUSPENDED"

	// ERROR indicates that the system encountered an error when attempting to
	// configure the load balancer.
	ERROR = "ERROR"

	// DELETED indicates that the LB has been deleted.
	DELETED = "DELETED"
)

// Datetime represents the structure of a Created or Updated field.
type Datetime struct {
	Time string
}

// LoadBalancer represents a load balancer API resource.
type LoadBalancer struct {
	// Human-readable name for the load balancer.
	Name string

	// The unique ID for the load balancer.
	ID int

	// Represents the service protocol being load balanced. See Protocol type for
	// a list of accepted values.
	// See http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/protocols.html
	// for a full list of supported protocols.
	Protocol string

	// Defines how traffic should be directed between back-end nodes. The default
	// algorithm is RANDOM. See Algorithm type for a list of accepted values.
	Algorithm Algorithm

	// The current status of the load balancer.
	Status Status

	// The number of load balancer nodes.
	NodeCount int `mapstructure:"nodeCount"`

	// Slice of virtual IPs associated with this load balancer.
	VIPs []vips.VIP `mapstructure:"virtualIps"`

	// Datetime when the LB was created.
	Created Datetime

	// Datetime when the LB was created.
	Updated Datetime

	// Port number for the service you are load balancing.
	Port int

	// HalfClosed provides the ability for one end of the connection to
	// terminate its output while still receiving data from the other end. This
	// is only available on TCP/TCP_CLIENT_FIRST protocols.
	HalfClosed bool

	// Timeout represents the timeout value between a load balancer and its
	// nodes. Defaults to 30 seconds with a maximum of 120 seconds.
	Timeout int

	// TODO
	Cluster Cluster

	// Nodes shows all the back-end nodes which are associated with the load
	// balancer. These are the devices which are delivered traffic.
	Nodes []nodes.Node

	// TODO
	ConnectionLogging ConnectionLogging

	// SessionPersistence specifies whether multiple requests from clients are
	// directed to the same node.
	SessionPersistence SessionPersistence

	// ConnectionThrottle specifies a limit on the number of connections per IP
	// address to help mitigate malicious or abusive traffic to your applications.
	ConnectionThrottle ConnectionThrottle

	// TODO
	SourceAddrs SourceAddrs `mapstructure:"sourceAddresses"`
}

// SourceAddrs - temp
type SourceAddrs struct {
	IPv4Public  string `json:"ipv4Public" mapstructure:"ipv4Public"`
	IPv4Private string `json:"ipv4Servicenet" mapstructure:"ipv4Servicenet"`
	IPv6Public  string `json:"ipv6Public" mapstructure:"ipv6Public"`
	IPv6Private string `json:"ipv6Servicenet" mapstructure:"ipv6Servicenet"`
}

// SessionPersistence - temp
type SessionPersistence struct {
	Type string `json:"persistenceType" mapstructure:"persistenceType"`
}

// ConnectionThrottle - temp
type ConnectionThrottle struct {
	MinConns     int `json:"minConnections" mapstructure:"minConnections"`
	MaxConns     int `json:"maxConnections" mapstructure:"maxConnections"`
	MaxConnRate  int `json:"maxConnectionRate" mapstructure:"maxConnectionRate"`
	RateInterval int `json:"rateInterval" mapstructure:"rateInterval"`
}

// ConnectionLogging - temp
type ConnectionLogging struct {
	Enabled bool
}

// Cluster - temp
type Cluster struct {
	Name string
}

// LBPage is the page returned by a pager when traversing over a collection of
// LBs.
type LBPage struct {
	pagination.LinkedPageBase
}

// IsEmpty checks whether a NetworkPage struct is empty.
func (p LBPage) IsEmpty() (bool, error) {
	is, err := ExtractLBs(p)
	if err != nil {
		return true, nil
	}
	return len(is) == 0, nil
}

// ExtractLBs accepts a Page struct, specifically a LBPage struct, and extracts
// the elements into a slice of LoadBalancer structs. In other words, a generic
// collection is mapped into a relevant slice.
func ExtractLBs(page pagination.Page) ([]LoadBalancer, error) {
	var resp struct {
		LBs []LoadBalancer `mapstructure:"loadBalancers" json:"loadBalancers"`
	}

	err := mapstructure.Decode(page.(LBPage).Body, &resp)

	return resp.LBs, err
}

type commonResult struct {
	gophercloud.Result
}

// Extract interprets any commonResult as a LB, if possible.
func (r commonResult) Extract() (*LoadBalancer, error) {
	if r.Err != nil {
		return nil, r.Err
	}

	var response struct {
		LB LoadBalancer `mapstructure:"loadBalancer"`
	}

	err := mapstructure.Decode(r.Body, &response)

	return &response.LB, err
}

// CreateResult represents the result of a create operation.
type CreateResult struct {
	commonResult
}

// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
	gophercloud.ErrResult
}

// UpdateResult represents the result of an update operation.
type UpdateResult struct {
	gophercloud.ErrResult
}

// GetResult represents the result of a get operation.
type GetResult struct {
	commonResult
}

// ProtocolPage is the page returned by a pager when traversing over a
// collection of LB protocols.
type ProtocolPage struct {
	pagination.SinglePageBase
}

// IsEmpty checks whether a ProtocolPage struct is empty.
func (p ProtocolPage) IsEmpty() (bool, error) {
	is, err := ExtractProtocols(p)
	if err != nil {
		return true, nil
	}
	return len(is) == 0, nil
}

// ExtractProtocols accepts a Page struct, specifically a ProtocolPage struct,
// and extracts the elements into a slice of LoadBalancer structs. In other
// words, a generic collection is mapped into a relevant slice.
func ExtractProtocols(page pagination.Page) ([]Protocol, error) {
	var resp struct {
		Protocols []Protocol `mapstructure:"protocols" json:"protocols"`
	}

	err := mapstructure.Decode(page.(ProtocolPage).Body, &resp)

	return resp.Protocols, err
}
