// ChatDelete deletes a message.
5989
func (rtm *Client) ChatDelete(channelID string, ts Timestamp) error {
	res := basicResponse{}
	err := NewExternalRequest().
		AsPost().
		WithScheme(APIScheme).
		WithHost(APIEndpoint).
		WithPath("api/chat.delete").
		WithPostData("token", rtm.Token).
		WithPostData("channel", channelID).
		WithPostData("ts", ts.String()).
		JSON(&res)

	if err != nil {
		return err
	}

	if !IsEmpty(res.Error) {
		return exception.New(res.Error)
	}
	if !res.OK {
		return exception.New("slack response `ok` is false.")
	}

	return nil
}
860382
func (table *RegommendTable) Delete(key interface{}) (*RegommendItem, error) {
	table.RLock()
	r, ok := table.items[key]
	if !ok {
		table.RUnlock()
		return nil, errors.New("Key not found in engine")
	}

	// engine value so we don't keep blocking the mutex.
	aboutToDeleteItem := table.aboutToDeleteItem
	table.RUnlock()

	// Trigger callbacks before deleting an item from engine.
	if aboutToDeleteItem != nil {
		aboutToDeleteItem(r)
	}

	r.RLock()
	defer r.RUnlock()

	table.Lock()
	defer table.Unlock()
	delete(table.items, key)

	return r, nil
}
1221761
func (h Handler) Delete(cmd common.DeleteRequest) error {
	_, err := h.doRequest(cmd, common.RequestDelete)
	return err
}
172391
func (t *LinodeService) Delete(linodeId int, skipChecks bool) (*LinodeResponse, error) {
	u := &url.Values{}
	u.Add("LinodeID", strconv.Itoa(linodeId))
	if skipChecks {
		u.Add("skipChecks", "1")
	}

	v := LinodeResponse{}
	if err := t.client.do("linode.delete", u, &v.Response); err != nil {
		return nil, err
	}

	if err := json.Unmarshal(v.RawData, &v.LinodeId); err != nil {
		return nil, err
	}
	return &v, nil
}
764726
func (self *Contact) Delete(handle string) (bool, error) {
	var res bool

	var params []interface{}
	if handle == "" {
		params = []interface{}{self.Key}
	} else {
		params = []interface{}{self.Key, handle}
	}
	if err := self.Call("contact.delete", params, &res); err != nil {
		return false, err
	}
	return res, nil
}
624409
func Delete(c *messagebird.Client, id string) (*Message, error) {
	message := &Message{}
	if err := c.Request(message, http.MethodDelete, path+"/"+id, nil); err != nil {
		return nil, err
	}

	return message, nil
}
1209591
func (vs *ValueMap) Delete(k Value) {
	if vs == nil {
		return
	}
	vs.hashMap.Delete(k)
}
204493
func (e *Env) Delete(k string) error {
	if strings.Contains(k, ".") {
		return fmt.Errorf("Unknown symbol '%s'", k)
	}

	e.Lock()
	delete(e.env, k)
	e.Unlock()

	return nil
}
1126866
func (e *SimpleEventHandler) Delete() {
	e.items = e.items[0 : len(e.items)-1]
	e.levels = e.levels[0 : len(e.levels)-1]
}
805461
func (ac *AMQPConnector) DeleteQueue(channel *amqp.Channel, queueName string) error {
	// First return value is number of messages removed
	_, err := channel.QueueDelete(
		queueName, // name
		false,     // ifUnused
		false,     // ifEmpty
		false,     // noWait
	)

	return err
}
1126673
func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha2.SSHCredential{})

	return err
}
477635
func (s *Sanitizer) Delete(ctx context.Context, key []byte) error {
	if !isKeySafe(key) {
		return trace.BadParameter(errorMessage)
	}
	return s.backend.Delete(ctx, key)
}
296236
func (c *CmdChatDeleteHistory) chatSendDeleteHistory(ctx context.Context) error {
	resolver, err := newChatConversationResolver(c.G())
	if err != nil {
		return err
	}

	conversation, _, err := resolver.Resolve(ctx, c.resolvingRequest, chatConversationResolvingBehavior{
		CreateIfNotExists: false,
		MustNotExist:      false,
		Interactive:       c.hasTTY,
		IdentifyBehavior:  keybase1.TLFIdentifyBehavior_CHAT_CLI,
	})
	if err != nil {
		return err
	}
	conversationInfo := conversation.Info

	arg := chat1.PostDeleteHistoryByAgeArg{
		ConversationID:   conversationInfo.Id,
		TlfName:          conversationInfo.TlfName,
		TlfPublic:        (conversationInfo.Visibility == keybase1.TLFVisibility_PUBLIC),
		IdentifyBehavior: keybase1.TLFIdentifyBehavior_CHAT_CLI,
		Age:              c.age,
	}

	chatFullName := conversationInfo.TlfName
	if conversationInfo.TopicName != "" {
		chatFullName = fmt.Sprintf("%s#%s", conversationInfo.TlfName, conversationInfo.TopicName)
	}

	// Ask for confirmation on this destructive operation.
	promptText := fmt.Sprintf("Permanently delete ALL chat history of [%s]?\nHit Enter to confirm, or Ctrl-C to cancel.", chatFullName)
	if c.age != gregor1.DurationSec(0) {
		promptText = fmt.Sprintf("Permanently delete all chat messages in [%s] older than %v?\nHit Enter to confirm, or Ctrl-C to cancel.",
			chatFullName, c.ageDesc)
	}
	_, err = c.G().UI.GetTerminalUI().Prompt(PromptDescriptorChatDeleteHistory, promptText)
	if err != nil {
		return err
	}

	_, err = resolver.ChatClient.PostDeleteHistoryByAge(ctx, arg)
	return err
}
746017
func (c *Client) UnpinChatMessage(chatID string) error {
	req := url.Values{}
	req.Set("chat_id", chatID)
	var unpinned bool
	return c.doRequest("unpinChatMessage", req, &unpinned)
}
47944
func (user *User) DeleteConversation(other uint64) error {
	return Db().Where(`("from" = ? AND "to" = ?) OR ("from" = ? AND "to" = ?)`, user.ID(), other, other, user.ID()).Delete(&Pm{})
}
1369576
func (callflow *CallFlow) Delete(client *messagebird.Client) error {
	return client.Request(nil, http.MethodDelete, apiRoot+"/call-flows/"+callflow.ID, nil)
}
1095692
func (s *DeleteParameterGroupOutput) SetDeletionMessage(v string) *DeleteParameterGroupOutput {
	s.DeletionMessage = &v
	return s
}