// Action API
// NewDeleteAction deletes alert entries based on filters.
973710
func NewDeleteAction(filters ...Filter) Action {
	return &action{action: deleteAction, filters: filters, f: deleteActionFunc}
}
750875
func (c ActionCollection) FilterToCardCreationActions() ActionCollection {
	newSlice := make(ActionCollection, 0, len(c))
	for _, action := range c {
		if action.DidCreateCard() {
			newSlice = append(newSlice, action)
		}
	}
	return newSlice
}
1222279
func NewDeleteUser(ctx *middleware.Context, handler DeleteUserHandler) *DeleteUser {
	return &DeleteUser{Context: ctx, Handler: handler}
}
396150
func NewActionFailCommand(ctx Context) (cmd.Command, error) {
	return &ActionFailCommand{ctx: ctx}, nil
}
124913
func (s *UsageService) NewDeleteTrafficMonitorParams(id string) *DeleteTrafficMonitorParams {
	p := &DeleteTrafficMonitorParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
593057
func NewOrderDelete(ctx *middleware.Context, handler OrderDeleteHandler) *OrderDelete {
	return &OrderDelete{Context: ctx, Handler: handler}
}
1300287
func executeAction(act rules.Action, configuration string, newContext change.Detector, contextChanges change.Set, actionChanges *change.Set) (change.Detector, change.Set, error) {
	if act == nil {
		return nil, nil, errs.New("rule can not be nil")
	}
	return act.OnChange(newContext, contextChanges, configuration, actionChanges)
}
1040853
func NewActionListener(handler ActionHandler, hostID string) *ActionListener {
	return &ActionListener{handler: handler, hostID: hostID}
}
598574
func NewActionAPIV2(ctx facade.Context) (*APIv2, error) {
	api, err := NewActionAPIV3(ctx)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &APIv2{api}, nil
}
206507
func NewDeletePolicy(ctx *middleware.Context, handler DeletePolicyHandler) *DeletePolicy {
	return &DeletePolicy{Context: ctx, Handler: handler}
}
179616
func NewFileMemberActionResult(Member *MemberSelector, Result *FileMemberActionIndividualResult) *FileMemberActionResult {
	s := new(FileMemberActionResult)
	s.Member = Member
	s.Result = Result
	return s
}
1055722
func NewDeleteRule(name string, filter Filter, action Action) Rule {
	return &rule{name: name, event: deleteEvent, filter: filter, action: action}
}
910540
func (a *AlertsService) Delete(id uint) (*http.Response, error) {
	u := fmt.Sprintf("alerts/%d", id)
	req, err := a.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

	return a.client.Do(req, nil)
}
1185992
func (c context) ReportAction(actionResponse updater.UpdatePromptResponse, update *updater.Update, options updater.UpdateOptions) {
	if err := c.reportAction(actionResponse, update, options, defaultEndpoints.action, time.Minute); err != nil {
		c.log.Warningf("Error notifying about an action (%s): %s", actionResponse.Action, err)
	}
}
727233
func (kf *KeyspaceFixer) Action(ctx context.Context, name string) error {
	if name == "Create" {
		return kf.ts.CreateKeyspace(ctx, kf.keyspace, &topodatapb.Keyspace{})
	}
	if name == "Delete" {
		return kf.ts.DeleteKeyspace(ctx, kf.keyspace)
	}
	return fmt.Errorf("unknown KeyspaceFixer action: %v", name)
}
1281373
func newActionDoc(mb modelBackend, receiverTag names.Tag, actionName string, parameters map[string]interface{}) (actionDoc, actionNotificationDoc, error) {
	prefix := ensureActionMarker(receiverTag.Id())
	actionId, err := NewUUID()
	if err != nil {
		return actionDoc{}, actionNotificationDoc{}, err
	}
	actionLogger.Debugf("newActionDoc name: '%s', receiver: '%s', actionId: '%s'", actionName, receiverTag, actionId)
	modelUUID := mb.modelUUID()
	return actionDoc{
			DocId:      mb.docID(actionId.String()),
			ModelUUID:  modelUUID,
			Receiver:   receiverTag.Id(),
			Name:       actionName,
			Parameters: parameters,
			Enqueued:   mb.nowToTheSecond(),
			Status:     ActionPending,
		}, actionNotificationDoc{
			DocId:     mb.docID(prefix + actionId.String()),
			ModelUUID: modelUUID,
			Receiver:  receiverTag.Id(),
			ActionID:  actionId.String(),
		}, nil
}
759343
func NewEvent(category string, action string) *Event {
	h := &Event{
		category: category,
		action:   action,
	}
	return h
}