package csbi

import (
	"context"
	"fmt"

	tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
	"github.com/openconfig/gnmi/proto/gnmi"
)

// Discover sends a gnmi Capabilities request to the specified target and
// returns the gnmi.ModelData.
func Discover(ctx context.Context, opts *tpb.TransportOption) ([]*gnmi.ModelData, error) {
	//sbi, err := nucleus.NewSBI(spb.Type_TYPE_OPENCONFIG)
	//if err != nil {
	//	return nil, err
	//}
	//t, err := nucleus.NewTransport(opts, sbi)
	//if err != nil {
	//	return nil, err
	//}
	//transport, ok := t.(*nucleus.Gnmi)
	//if !ok {
	//	return nil, &customerrs.InvalidTypeAssertionError{}
	//}
	//resp, err := transport.Capabilities(ctx)
	//if err != nil {
	//	return nil, err
	//}
	//capabilities, ok := resp.(*gnmi.CapabilityResponse)
	//if !ok {
	//	return nil, &customerrs.InvalidTypeAssertionError{
	//		Value: resp,
	//		Type:  reflect.TypeOf(&gnmi.CapabilityResponse{}),
	//	}
	//}
	//return capabilities.SupportedModels, nil
	return nil, fmt.Errorf("currently not implemented")
}
