/*
DeleteChatStickerSet delete a group sticker set from a supergroup
*/
181911
func (c *Client) DeleteChatStickerSet(chatID string) error {
	req := url.Values{}
	req.Set("chat_id", chatID)
	var deleted bool
	return c.doRequest("deleteChatStickerSet", req, &deleted)
}
1224014
func (c *Client) DeleteSecGroup(guid string) error {
	//Perform the DELETE and check for errors
	resp, err := c.DoRequest(c.NewRequest("DELETE", fmt.Sprintf("/v2/security_groups/%s", guid)))
	if err != nil {
		return err
	}
	if resp.StatusCode != 204 { //204 No Content
		return fmt.Errorf("CF API returned with status code %d", resp.StatusCode)
	}
	return nil
}
1259821
func (c *Client) DeleteSecurityGroup(p *DeleteSecurityGroupParameter) (*Result, error) {
	obj, err := c.Request("deleteSecurityGroup", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
414327
func (s *VMGroupService) DeleteInstanceGroup(p *DeleteInstanceGroupParams) (*DeleteInstanceGroupResponse, error) {
	resp, err := s.cs.newRequest("deleteInstanceGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteInstanceGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
826550
func DeleteEndpointGroup(key string) error {
	collections.endpointGroupMutex.Lock()
	obj := collections.endpointGroups[key]
	collections.endpointGroupMutex.Unlock()
	if obj == nil {
		log.Errorf("endpointGroup %s not found", key)
		return errors.New("endpointGroup not found")
	}

	// Check if we handle this object
	if objCallbackHandler.EndpointGroupCb == nil {
		log.Errorf("No callback registered for endpointGroup object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.EndpointGroupCb.EndpointGroupDelete(obj)
	if err != nil {
		log.Errorf("EndpointGroupDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	// delete it from modeldb
	collections.endpointGroupMutex.Lock()
	err = obj.Delete()
	collections.endpointGroupMutex.Unlock()
	if err != nil {
		log.Errorf("Error deleting endpointGroup %s. Err: %v", obj.Key, err)
	}

	// delete it from cache
	collections.endpointGroupMutex.Lock()
	delete(collections.endpointGroups, key)
	collections.endpointGroupMutex.Unlock()

	return nil
}
688732
func (c *FakeInstanceGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &v1alpha2.InstanceGroupList{})
	return err
}
1091485
func DeleteMulticastGroup(db sqlx.Execer, id uuid.UUID) error {
	res, err := db.Exec(`
		delete from
			multicast_group
		where
			id = $1`,
		id,
	)
	if err != nil {
		return handlePSQLError(err, "delete error")
	}

	ra, err := res.RowsAffected()
	if err != nil {
		return handlePSQLError(err, "get rows affected error")
	}
	if ra == 0 {
		return ErrDoesNotExist
	}

	log.WithFields(log.Fields{
		"id": id,
	}).Info("multicast-group deleted")

	return nil
}
261153
func GroupDelete(ctx context.Context, groupName string) error {
	return groupServiceInstance.GroupDelete(ctx, groupName)
}
899906
func (s *GroupsService) DeleteGroupDescription(groupID string) (*Response, error) {
	u := fmt.Sprintf("groups/%s/description'", groupID)
	return s.client.DeleteRequest(u, nil)
}
907456
func (c *FakeGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(groupsResource, listOptions)

	_, err := c.Fake.Invokes(action, &user.GroupList{})
	return err
}
931785
func (s *netCls) DeleteCgroup(cgroupname string) error {

	_, err := os.Stat(filepath.Join(basePath, s.TriremePath, cgroupname))
	if os.IsNotExist(err) {
		zap.L().Debug("Group already deleted", zap.Error(err))
		return nil
	}

	err = os.Remove(filepath.Join(basePath, s.TriremePath, cgroupname))
	if err != nil {
		return fmt.Errorf("unable to delete cgroup %s: %s", cgroupname, err)
	}

	return nil
}
1242765
func (s *Service) DeleteLabelMapping(ctx context.Context, m *influxdb.LabelMapping) error {
	s.labelMappingKV.Delete(encodeLabelMappingKey(m))
	return nil
}
1343937
func (s *AutoScaleService) DeleteAutoScaleVmGroup(p *DeleteAutoScaleVmGroupParams) (*DeleteAutoScaleVmGroupResponse, error) {
	resp, err := s.cs.newRequest("deleteAutoScaleVmGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteAutoScaleVmGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
1131094
func (c *FakeGroups) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(groupsResource, name), &user.Group{})
	return err
}
680719
func NewStickerShare(chatID int64, fileID string) StickerConfig {
	return StickerConfig{
		BaseFile: BaseFile{
			BaseChat:    BaseChat{ChatID: chatID},
			FileID:      fileID,
			UseExisting: true,
		},
	}
}
460370
func (s *SeriesIDSet) RemoveSet(other *SeriesIDSet) {
	s.RLock()
	defer s.RUnlock()
	other.RLock()
	defer other.RUnlock()
	s.bitmap.AndNot(other.bitmap)
}
1235218
func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &appsv1.DaemonSetList{})
	return err
}