// Delete will remove an existing agent. Note: The agent must be disabled, and not currently building to be deleted.
516369
func (s *AgentsService) Delete(ctx context.Context, uuid string) (string, *APIResponse, error) {
	return s.client.deleteAction(ctx, "agents/"+uuid, apiV4)
}
587745
func (c *Client) Delete(key string) error {
	return c.deleteRecurse(key, false)
}
620561
func (c *Client) Remove(ctx context.Context, key string) error {
	if err := c.checkAgent(ctx); err != nil {
		return errors.Wrapf(err, "agent not available: %s", err)
	}

	u, err := url.Parse("http://unix/cache/remove")
	if err != nil {
		return errors.Wrapf(err, "failed to build request url")
	}

	values := u.Query()
	values.Set("key", key)
	u.RawQuery = values.Encode()

	resp, err := c.http.Get(u.String())
	if err != nil {
		return errors.Wrapf(err, "failed to talk to agent")
	}
	defer func() { _ = resp.Body.Close() }()

	if resp.StatusCode != http.StatusOK {
		return fmt.Errorf("request failed: %d", resp.StatusCode)
	}

	return nil
}
877147
func (s *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) {
	return &metav1.Status{Status: metav1.StatusSuccess}, false, s.client.Delete(name, nil)
}
678771
func (t *Manager) Delete(api Definition) {
	key := t.GetMethodPatternKey(t, api)
	delete(t.apiMethodPatternMap, key)
}
1218096
func (s *Action) Delete(ctx context.Context, c *cli.Context) error {
	force := c.Bool("force")
	recursive := c.Bool("recursive")

	name := c.Args().First()
	if name == "" {
		return ExitError(ctx, ExitUsage, nil, "Usage: %s rm name", s.Name)
	}

	if !recursive && s.Store.IsDir(ctx, name) {
		return ExitError(ctx, ExitUsage, nil, "Cannot remove '%s': Is a directory. Use 'gopass rm -r %s' to delete", name, name)
	}

	// specifying a key is optional
	key := c.Args().Get(1)

	if !force { // don't check if it's force anyway
		recStr := ""
		if recursive {
			recStr = "recursively "
		}
		if (s.Store.Exists(ctx, name) || s.Store.IsDir(ctx, name)) && key == "" && !termio.AskForConfirmation(ctx, fmt.Sprintf("Are you sure you would like to %sdelete %s?", recStr, name)) {
			return nil
		}
	}

	if recursive {
		if err := s.Store.Prune(ctx, name); err != nil {
			return ExitError(ctx, ExitUnknown, err, "failed to prune '%s': %s", name, err)
		}
		return nil
	}

	// deletes a single key from a YAML doc
	if key != "" {
		return s.deleteKeyFromYAML(ctx, name, key)
	}

	if err := s.Store.Delete(ctx, name); err != nil {
		return ExitError(ctx, ExitIO, err, "Can not delete '%s': %s", name, err)
	}
	return nil
}
112810
func (c *FakeProjects) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(projectsResource, name), &project.Project{})
	return err
}
819423
func (b *bundle) Delete() error {
	err := atomicDelete(b.path)
	if err == nil {
		return atomicDelete(b.workDir)
	}
	// error removing the bundle path; still attempt removing work dir
	err2 := atomicDelete(b.workDir)
	if err2 == nil {
		return err
	}
	return errors.Wrapf(err, "Failed to remove both bundle and workdir locations: %v", err2)
}
779168
func Delete(builder interface{}, name string) interface{} {
	b := Builder{getBuilderMap(builder).Delete(name)}
	return convert(b, builder)
}
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)
}
775950
func (r *Runtime) Delete() (err error) {
	var args []string
	args = append(args, "delete")
	if r.ID != "" {
		args = append(args, r.ID)
	}

	cmd := exec.Command(r.RuntimeCommand, args...)
	return execWithStderrFallbackToStdout(cmd)
}
312005
func (session Session) Delete() error {
	if !session.Exists() {
		return fmt.Errorf("auth: keyless sessions cannot be deleted")
	}
	return session.manager.Delete(session.Key)
}
609270
func (b *Builder) Delete(conds ...Cond) *Builder {
	b.cond = b.cond.And(conds...)
	b.optype = deleteType
	return b
}
1353929
func (c *FakeAppProjects) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(appprojectsResource, c.ns, name), &v1alpha1.AppProject{})

	return err
}
42521
func (c *FakeUserIdentityMappings) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(useridentitymappingsResource, name), &user.UserIdentityMapping{})
	return err
}
229532
func (p *PathStruct) Delete(ctx context.Context, s logical.Storage) error {
	return s.Delete(ctx, fmt.Sprintf("struct/%s", p.Name))
}
1169096
func (c *FakeBundles) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(bundlesResource, c.ns, name), &smithv1.Bundle{})

	return err
}