// Delete deletes the given Security Group
547198
func (sg SecurityGroup) Delete(ctx context.Context, client *Client) error {
	if sg.ID == nil && sg.Name == "" {
		return fmt.Errorf("a SecurityGroup may only be deleted using ID or Name")
	}

	req := &DeleteSecurityGroup{}

	if sg.ID != nil {
		req.ID = sg.ID
	} else {
		req.Name = sg.Name
	}

	return client.BooleanRequestWithContext(ctx, req)
}
1002803
func (c *FakePodSecurityPolicies) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{})
	return err
}
405736
func (c *VSphereCloud) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error {
	glog.V(8).Infof("vSphere cloud provider DeleteGroup not implemented yet")
	return fmt.Errorf("vSphere cloud provider does not support deleting cloud groups at this time.")
}
1099932
func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams {
	p := &DeleteSecurityGroupParams{}
	p.p = make(map[string]interface{})
	return p
}
62302
func (ip *Interpreter) deleteGroup(args []string) {
	ip.simpleResponder(ip.Backend.DeleteGroup(args[0]))
}
126025
func (s *memcachedStorage) Delete(key string) error {
	return s.c.Delete(key)
}
663000
func (c *FakeSecurityContextConstraints) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(securitycontextconstraintsResource, name), &security.SecurityContextConstraints{})
	return err
}
1329358
func (property *Property) Delete() error {
	// /papi/v1/properties/{propertyId}{?contractId,groupId}
	req, err := client.NewRequest(
		Config,
		"DELETE",
		fmt.Sprintf(
			"/papi/v1/properties/%s",
			property.PropertyID,
		),
		nil,
	)
	if err != nil {
		return err
	}

	res, err := client.Do(Config, req)
	if err != nil {
		return err
	}

	if client.IsError(res) {
		return client.NewAPIError(res)
	}

	return nil
}
473430
func (smap *syncedMap) Delete(key interface{}) {
	smap.Lock()
	defer smap.Unlock()

	delete(smap.data, key)
}
383346
func (ag AffinityGroup) Delete(ctx context.Context, client *Client) error {
	if ag.ID == nil && ag.Name == "" {
		return fmt.Errorf("an Affinity Group may only be deleted using ID or Name")
	}

	req := &DeleteAffinityGroup{}

	if ag.ID != nil {
		req.ID = ag.ID
	} else {
		req.Name = ag.Name
	}

	return client.BooleanRequestWithContext(ctx, req)
}
1131094
func (c *FakeGroups) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(groupsResource, name), &user.Group{})
	return err
}
1294496
func (ssh SSHKeyPair) Delete(ctx context.Context, client *Client) error {
	if ssh.Name == "" {
		return fmt.Errorf("an SSH Key Pair may only be deleted using Name")
	}

	return client.BooleanRequestWithContext(ctx, &DeleteSSHKeyPair{
		Name: ssh.Name,
	})
}
1020067
func (s *Statement) Delete(m Code, key Code) *Statement {
	g := &Group{
		close:     ")",
		items:     []Code{m, key},
		multi:     false,
		name:      "delete",
		open:      "delete(",
		separator: ",",
	}
	*s = append(*s, g)
	return s
}
516369
func (s *AgentsService) Delete(ctx context.Context, uuid string) (string, *APIResponse, error) {
	return s.client.deleteAction(ctx, "agents/"+uuid, apiV4)
}
791736
func (r *ShardedTTL) Delete(tenantID, key string) error {
	r.Lock()
	defer r.Unlock()

	r.delete(tenantID, key)
	return nil
}
642329
func (aug *AuthUserGroup) Delete(db XODB) error {
	var err error

	// if doesn't exist, bail
	if !aug._exists {
		return nil
	}

	// if deleted, bail
	if aug._deleted {
		return nil
	}

	// sql query
	const sqlstr = `DELETE FROM django.auth_user_groups WHERE id = :1`

	// run query
	XOLog(sqlstr, aug.ID)
	_, err = db.Exec(sqlstr, aug.ID)
	if err != nil {
		return err
	}

	// set deleted
	aug._deleted = true

	return nil
}
466074
func (c *gceCloudImplementation) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error {
	return deleteCloudInstanceGroup(c, g)
}