//Delete is a method on an Application which request an Application be deleted in Kumoru.
421752
func (a *Application) Delete() (*Application, *http.Response, []error) {
	k := kumoru.New()

	k.Delete(fmt.Sprintf("%s/v1/applications/%s", k.EndPoint.Application, a.UUID))
	k.SignRequest(true)

	resp, _, errs := k.End()

	if len(errs) > 0 {
		return a, resp, errs
	}

	if resp.StatusCode >= 400 {
		errs = append(errs, fmt.Errorf("%s", resp.Status))
	}

	return a, resp, nil
}
145981
func (p *RequestParams) Delete(params ...string) (err error) {
	if p == nil {
		return
	}
	for _, param := range params {
		if err = p.delete(param); err != nil {
			return
		}
	}
	return
}
800285
func (c *MemcacheCacher) Delete(key string) error {
	return c.c.Delete(key)
}
813824
func (_m *ClusterServiceServer) Delete(_a0 context.Context, _a1 *cluster.ClusterQuery) (*cluster.ClusterResponse, error) {
	ret := _m.Called(_a0, _a1)

	var r0 *cluster.ClusterResponse
	if rf, ok := ret.Get(0).(func(context.Context, *cluster.ClusterQuery) *cluster.ClusterResponse); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*cluster.ClusterResponse)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *cluster.ClusterQuery) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1249716
func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) {
	return k.deleteInternal(key, nil, w)
}
556033
func (c *Cacher) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions) error {
	return c.storage.Delete(ctx, key, out, preconditions)
}
1255058
func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) {
	_, qm, err := k.deleteInternal(key, nil, w)
	return qm, err
}
481338
func (session *Session) Delete(path string, params Params) (Result, error) {
	return session.Api(path, DELETE, params)
}
393905
func (k *Client) Delete(targetURL string) {
	k.ClearClient()
	k.Method = DELETE
	k.URL = targetURL
	k.Errors = nil
}
1056038
func (f *Request) Delete(url string) *Request {
	f.Url(url).Method("DELETE")
	return f
}
873077
func (r *AppService) Delete(id string) *AppDeleteCall {
	c := &AppDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.id = id
	return c
}
416724
func (s *storeImpl) Delete(key string) {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	delete(s.objects, key)
}
1321862
func (g *Goon) Delete(key *datastore.Key) error {
	keys := []*datastore.Key{key}
	err := g.DeleteMulti(keys)
	if me, ok := err.(appengine.MultiError); ok {
		return me[0]
	}
	return err
}
948585
func (immutable *Immutable) Delete(entries ...Entry) (*Immutable, Entries) {
	if len(entries) == 0 {
		return immutable, Entries{}
	}

	deleted := make(Entries, 0, len(entries))
	cp := immutable.copy()
	for _, e := range entries {
		deleted = append(deleted, cp.delete(e))
	}

	return cp, deleted
}
707869
func (c *SpaceController) Delete(ctx *app.DeleteSpaceContext) error {
	currentUser, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))
	}

	spaceID, err := goauuid.FromString(ctx.SpaceID.String())
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"space_id": ctx.SpaceID,
			"err":      err,
		}, "could not convert the UUID of type github.com/satori/go.uuid to github.com/goadesign/goa/uuid")
		return jsonapi.JSONErrorResponse(
			ctx, errors.NewInternalError(ctx, errs.Wrap(err, "could not delete space")),
		)
	}

	// extract config in it's generic form to be utilized elsewhere
	config, ok := c.config.(*configuration.Registry)
	if !ok {
		log.Error(ctx, map[string]interface{}{
			"space_id": spaceID,
		}, "no configuation found in SpaceController object")
		return jsonapi.JSONErrorResponse(
			ctx, errors.NewInternalErrorFromString("could not delete space"),
		)
	}

	// delete all the codebases associated with this space
	err = deleteCodebases(c.CodebaseClient, config, ctx.Context, spaceID)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"space_id": spaceID,
			"err":      err,
		}, "could not delete codebases")
		return jsonapi.JSONErrorResponse(
			ctx, errors.NewInternalError(ctx, errs.Wrapf(err, "failed to delete codebases associated with space %s", spaceID)))
	}

	// now delete the OpenShift resources associated with this space on an
	// OpenShift cluster, unless otherwise specified
	if ctx.SkipCluster == nil || !*ctx.SkipCluster {
		err = deleteOpenShiftResource(c.DeploymentsClient, config, ctx.Context, spaceID)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"space_id": spaceID,
				"err":      err,
			}, "could not delete OpenShift resources")
			return jsonapi.JSONErrorResponse(
				ctx, errors.NewInternalError(ctx, errs.Wrapf(
					err, "could not delete Openshift resources associated with space %s", spaceID),
				),
			)
		}
	}

	err = application.Transactional(c.db, func(appl application.Application) error {
		s, err := appl.Spaces().Load(ctx.Context, ctx.SpaceID)
		if err != nil {
			return err
		}
		if !uuid.Equal(*currentUser, s.OwnerID) {
			log.Warn(ctx, map[string]interface{}{
				"space_id":     ctx.SpaceID,
				"space_owner":  s.OwnerID,
				"current_user": *currentUser,
			}, "user is not the space owner")
			return errors.NewForbiddenError("user is not the space owner")
		}
		return appl.Spaces().Delete(ctx.Context, ctx.SpaceID)
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	err = c.resourceManager.DeleteSpace(ctx, ctx.Request, ctx.SpaceID.String())
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK([]byte{})
}
678771
func (t *Manager) Delete(api Definition) {
	key := t.GetMethodPatternKey(t, api)
	delete(t.apiMethodPatternMap, key)
}
110628
func (api *APIBuilder) Delete(relativePath string, handlers ...context.Handler) *Route {
	return api.Handle(http.MethodDelete, relativePath, handlers...)
}