func (lgc *Logic) DeleteIndexSet(id string) (int, error) {
	ok, err := lgc.HasIndexSet(id)
	if err != nil {
		lgc.Logger().WithFields(log.Fields{
			"error": err, "id": id,
		}).Error("lgc.HasIndexSet() is failure")
		return 500, err
	}
	if !ok {
		return 404, fmt.Errorf("no indexSet with id <%s> is not found", id)
	}
	defID, err := lgc.store.GetDefaultIndexSetID()
	if err != nil {
		return 500, err
	}
	if id == defID {
		return 400, fmt.Errorf("default index set <%s> cannot be deleted", id)
	}
	if err := lgc.store.DeleteIndexSet(id); err != nil {
		return 500, err
	}
	return 204, nil
}
// DeleteIndexSet removes a index set from the Mock Server.
DeleteIndexSet removes a index set from the Mock Server.
// DeleteIndexSet removes a index set from the Mock Server .
func (lgc *Logic) DeleteIndexSet(id string) (int, error) {
	ok, err := lgc.HasIndexSet(id)
	if err != nil {
		lgc.Logger().WithFields(log.Fields{
			"error": err, "id": id,
		}).Error("lgc.HasIndexSet() is failure")
		return 500, err
	}
	if !ok {
		return 404, fmt.Errorf("no indexSet with id <%s> is not found", id)
	}
	defID, err := lgc.store.GetDefaultIndexSetID()
	if err != nil {
		return 500, err
	}
	if id == defID {
		return 400, fmt.Errorf("default index set <%s> cannot be deleted", id)
	}
	if err := lgc.store.DeleteIndexSet(id); err != nil {
		return 500, err
	}
	return 204, nil
}
func ( lgc * Logic ) DeleteIndexSet ( id string ) ( int , error ) { ok , err := lgc . HasIndexSet ( id ) if err != nil { lgc . Logger ( ) . WithFields ( log . Fields { " " : err , " " : id , } ) . Error ( " " ) return 500 , err } if ! ok { return 404 , fmt . Errorf ( " " , id ) } defID , err := lgc . store . GetDefaultIndexSetID ( ) if err != nil { return 500 , err } if id == defID { return 400 , fmt . Errorf ( " " , id ) } if err := lgc . store . DeleteIndexSet ( id ) ; err != nil { return 500 , err } return 204 , nil }
DeleteIndexSet removes a index set from the Mock Server.
DeleteIndexSet removes a index set from the Mock Server .