func (c *EpinioClient) DeleteService(name string, unbind bool) error {
	log := c.Log.WithName("Delete Service").
		WithValues("Name", name, "Namespace", c.Config.Org)
	log.Info("start")
	defer log.Info("return")
	c.ui.Note().
		WithStringValue("Name", name).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Delete Service")
	if err := c.TargetOk(); err != nil {
		return err
	}
	request := models.ServiceDeleteRequest{
		Unbind: unbind,
	}
	var bound []string
	_, err := c.API.ServiceDelete(request, c.Config.Org, name,
		func(response *http.Response, bodyBytes []byte, err error) error {
			if response.StatusCode != http.StatusBadRequest {
				return err
			}
			var apiError apierrors.ErrorResponse
			if err := json.Unmarshal(bodyBytes, &apiError); err != nil {
				return err
			}
			bound = strings.Split(apiError.Errors[0].Details, ",")
			return nil
		})
	if err != nil {
		return err
	}
	if len(bound) > 0 {
		sort.Strings(bound)
		sort.Strings(bound)
		msg := c.ui.Exclamation().WithTable("Bound Applications")
		for _, app := range bound {
			msg = msg.WithTableRow(app)
		}
		msg.Msg("Unable to delete service. It is still used by")
		c.ui.Exclamation().Compact().Msg("Use --unbind to force the issue")
		return nil
	}
	c.ui.Success().
		WithStringValue("Name", name).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Service Removed.")
	return nil
}
DeleteService deletes a service specified by name
package usercmd
import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"sort"
	"strings"
	apierrors "github.com/epinio/epinio/pkg/api/core/v1/errors"
	"github.com/epinio/epinio/pkg/api/core/v1/models"
)
func (c *EpinioClient) Services() error {
	log := c.Log.WithName("Services").WithValues("Namespace", c.Config.Org)
	log.Info("start")
	defer log.Info("return")
	details := log.V(1)  
	c.ui.Note().
		WithStringValue("Namespace", c.Config.Org).
		Msg("Listing services")
	if err := c.TargetOk(); err != nil {
		return err
	}
	details.Info("list services")
	response, err := c.API.Services(c.Config.Org)
	if err != nil {
		return err
	}
	details.Info("list services")
	sort.Sort(response)
	msg := c.ui.Success().WithTable("Name", "Applications")
	details.Info("list services")
	for _, service := range response {
		msg = msg.WithTableRow(service.Name, strings.Join(service.BoundApps, ", "))
	}
	msg.Msg("Epinio Services:")
	return nil
}
func (c *EpinioClient) ServiceMatching(ctx context.Context, prefix string) []string {
	log := c.Log.WithName("ServiceMatching").WithValues("PrefixToMatch", prefix)
	log.Info("start")
	defer log.Info("return")
	details := log.V(1)  
	result := []string{}
	response, err := c.API.Services(c.Config.Org)
	if err != nil {
		return result
	}
	for _, s := range response {
		service := s.Name
		details.Info("Found", "Name", service)
		if strings.HasPrefix(service, prefix) {
			details.Info("Matched", "Name", service)
			result = append(result, service)
		}
	}
	return result
}
func (c *EpinioClient) BindService(serviceName, appName string) error {
	log := c.Log.WithName("Bind Service To Application").
		WithValues("Name", serviceName, "Application", appName, "Namespace", c.Config.Org)
	log.Info("start")
	defer log.Info("return")
	c.ui.Note().
		WithStringValue("Service", serviceName).
		WithStringValue("Application", appName).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Bind Service")
	if err := c.TargetOk(); err != nil {
		return err
	}
	request := models.BindRequest{
		Names: []string{serviceName},
	}
	br, err := c.API.ServiceBindingCreate(request, c.Config.Org, appName)
	if err != nil {
		return err
	}
	if len(br.WasBound) > 0 {
		c.ui.Success().
			WithStringValue("Service", serviceName).
			WithStringValue("Application", appName).
			WithStringValue("Namespace", c.Config.Org).
			Msg("Service Already Bound to Application.")
		return nil
	}
	c.ui.Success().
		WithStringValue("Service", serviceName).
		WithStringValue("Application", appName).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Service Bound to Application.")
	return nil
}
func (c *EpinioClient) UnbindService(serviceName, appName string) error {
	log := c.Log.WithName("Unbind Service").
		WithValues("Name", serviceName, "Application", appName, "Namespace", c.Config.Org)
	log.Info("start")
	defer log.Info("return")
	c.ui.Note().
		WithStringValue("Service", serviceName).
		WithStringValue("Application", appName).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Unbind Service from Application")
	if err := c.TargetOk(); err != nil {
		return err
	}
	_, err := c.API.ServiceBindingDelete(c.Config.Org, appName, serviceName)
	if err != nil {
		return err
	}
	c.ui.Success().
		WithStringValue("Service", serviceName).
		WithStringValue("Application", appName).
		WithStringValue("Namespace", c.Config.Org).
		Msg("Service Detached From Application.")
	return nil
}