// Delete takes name of the role and deletes it. Returns an error if one occurs.
553450
func (c *roles) Delete(name string, options *v1.DeleteOptions) error {
	return c.client.Delete().
		Namespace(c.ns).
		Resource("roles").
		Name(name).
		Body(options).
		Do().
		Error()
}
449036
func Delete(name string) {
	configsGuard.Lock()
	defer configsGuard.Unlock()
	delete(configs, name)
}
759180
func (c *FakeEvents) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &v1beta1.Event{})

	return err
}
705612
func (c *role) erase() error {
	if err := c.accessCache.DeleteAllRoles(); err != nil {
		if !trace.IsNotFound(err) {
			return trace.Wrap(err)
		}
	}
	return nil
}
135095
func (t *GenericCredential) Delete() (err error) {
	err = sysCredDelete(&t.Credential, sysCRED_TYPE_GENERIC)
	return
}
1044719
func (c *oAuthClientAuthorizations) Delete(name string, options *v1.DeleteOptions) error {
	return c.client.Delete().
		Resource("oauthclientauthorizations").
		Name(name).
		Body(options).
		Do().
		Error()
}
947859
func (db *Database) RemoveRole(role string) error {
	sec, err := db.GetSecurity()
	if err != nil {
		return err
	}
	remove := func(isAdmin bool) bool {
		var rolesPtr *[]string
		if isAdmin {
			rolesPtr = &sec.Admins.Roles
		} else {
			rolesPtr = &sec.Members.Roles
		}
		roles := *rolesPtr
		for i, r := range roles {
			if r == role {
				*rolesPtr = append(roles[:i], roles[i+1:]...)
				return true
			}
		}
		return false
	}
	var removed bool = false
	if removed = remove(false); !removed {
		removed = remove(true)
	}
	if removed {
		return db.SaveSecurity(*sec)
	}
	return nil
}
411622
func (s *AccessService) DeleteAllRoles() error {
	return s.DeleteRange(context.TODO(), backend.Key(rolesPrefix), backend.RangeEnd(backend.Key(rolesPrefix)))
}
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)
}
728197
func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batchv1.Job{})

	return err
}
516369
func (s *AgentsService) Delete(ctx context.Context, uuid string) (string, *APIResponse, error) {
	return s.client.deleteAction(ctx, "agents/"+uuid, apiV4)
}
1221761
func (h Handler) Delete(cmd common.DeleteRequest) error {
	_, err := h.doRequest(cmd, common.RequestDelete)
	return err
}
452135
func (b *backend) roleIDEntryDelete(ctx context.Context, s logical.Storage, roleID string) error {
	if roleID == "" {
		return fmt.Errorf("missing role id")
	}

	lock := b.roleIDLock(roleID)
	lock.Lock()
	defer lock.Unlock()

	salt, err := b.Salt(ctx)
	if err != nil {
		return err
	}
	entryIndex := "role_id/" + salt.SaltID(roleID)

	return s.Delete(ctx, entryIndex)
}
112810
func (c *FakeProjects) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(projectsResource, name), &project.Project{})
	return err
}
90805
func (c *FakeUsers) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(usersResource, name), &user.User{})
	return err
}
1044494
func (c *FakeControllerRevisions) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{})

	return err
}
55527
func (s *AccessService) DeleteRole(name string) error {
	if name == "" {
		return trace.BadParameter("missing role name")
	}
	err := s.Delete(context.TODO(), backend.Key(rolesPrefix, name, paramsPrefix))
	if err != nil {
		if trace.IsNotFound(err) {
			return trace.NotFound("role %q is not found", name)
		}
	}
	return trace.Wrap(err)
}