// CanonicalActionName sets the name of the action used to compute the resource collection and
//
// resource collection items hrefs. See Resource.
164961
func CanonicalActionName(a string) {
	if r, ok := resourceDefinition(); ok {
		r.CanonicalActionName = a
	}
}
809323
func SetAction(name string, action func()) {
	if name == "" {
		panic("daemonigo.SetAction(): name cannot be empty")
	}
	if action == nil {
		panic("daemonigo.SetAction(): action cannot be nil")
	}
	actions[name] = action
}
635894
func HandleAction(name string, params map[string]interface{}) (results map[string]interface{}, err error) {
	spec, ok := actions.PredefinedActionsSpec[name]
	if !ok {
		return nil, errors.Errorf("unexpected action %s", name)
	}
	if err := spec.ValidateParams(params); err != nil {
		return nil, errors.Errorf("invalid action parameters")
	}

	switch name {
	case actions.JujuRunActionName:
		return handleJujuRunAction(params)
	default:
		return nil, errors.Errorf("unexpected action %s", name)
	}
}
360935
func (a *Action) ChainAction(f ActionInterface) ActionInterface {
	if a == f {
		return a
	}

	return a.UseThen(func(b interface{}, to ActionInterface) {
		to.Fullfill(b)
	}, f)
}
1205913
func newAction(st *State, adoc actionDoc) Action {
	return &action{
		st:  st,
		doc: adoc,
	}
}
743667
func (a *ActionDefinition) CanonicalScheme() string {
	if a.WebSocket() {
		for _, s := range a.EffectiveSchemes() {
			if s == "wss" {
				return s
			}
		}
		return "ws"
	}
	for _, s := range a.EffectiveSchemes() {
		if s == "https" {
			return s
		}
	}
	return "http"
}
1364379
func (a *ActDepend) ChainAction(f ActionInterface) ActionInterface {
	return a.current().ChainAction(f)
}
1248366
func (s *DatasetActionSummary) SetActionName(v string) *DatasetActionSummary {
	s.ActionName = &v
	return s
}
1035741
func getActionTagsByPrefix(api APIClient, prefix string) ([]names.ActionTag, error) {
	results := []names.ActionTag{}

	tags, err := api.FindActionTagsByPrefix(params.FindTags{Prefixes: []string{prefix}})
	if err != nil {
		return results, err
	}

	matches, ok := tags.Matches[prefix]
	if !ok || len(matches) < 1 {
		return results, nil
	}

	results, rejects := getActionTags(matches)
	if len(rejects) > 0 {
		logger.Errorf("FindActionTagsByPrefix for prefix %q found invalid tags %v", prefix, rejects)
	}
	return results, nil
}
1015817
func (ctx *HookContext) ActionName() (string, error) {
	if ctx.actionData == nil {
		return "", errors.New("not running an action")
	}
	return ctx.actionData.Name, nil
}
953697
func (st *State) Action(tag names.ActionTag) (*Action, error) {
	result, err := st.getOneAction(&tag)
	if err != nil {
		return nil, err
	}
	return &Action{
		name:   result.Action.Name,
		params: result.Action.Parameters,
	}, nil
}
258701
func (v CompatibilityAction) String() string {
	actions := map[CompatibilityAction]string{
		compatRebuild: "rebuild",
		compatUpgrade: "upgrade",
		compatReindex: "reindex",
		compatOK:      "ok",
	}
	if actionStr, ok := actions[v]; ok {
		return actionStr
	}
	return "unknown"
}
420834
func MakeCanonicalName(resolvedWriters []kbname.NormalizedUsername,
	unresolvedWriters []keybase1.SocialAssertion,
	resolvedReaders []kbname.NormalizedUsername,
	unresolvedReaders []keybase1.SocialAssertion,
	extensions []HandleExtension) CanonicalName {
	return makeCanonicalName(
		resolvedWriters, unresolvedWriters, resolvedReaders, unresolvedReaders,
		extensions, false)
}
881649
func (ca *CoreAdmin) Action(action string, params *url.Values) (*SolrResponse, error) {
	switch strings.ToUpper(action) {
	case "STATUS":
		params.Set("action", "STATUS")
	case "RELOAD":
		params.Set("action", "RELOAD")
	case "CREATE":
		params.Set("action", "CREATE")
	case "RENAME":
		params.Set("action", "RENAME")
	case "SWAP":
		params.Set("action", "SWAP")
	case "UNLOAD":
		params.Set("action", "UNLOAD")
	case "SPLIT":
		params.Set("action", "SPLIT")
	case "MERGEINDEXES":
		params.Set("action", "mergeindexes")
	default:
		return nil, fmt.Errorf("Action '%s' not supported", action)
	}
	return ca.Get("cores", params)
}
443377
func (c *Client) IntervalActionByName(name string) (action contract.IntervalAction, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	err = getObjectByKey(conn, models.IntervalActionNameKey, name, &action)
	return action, err
}
554346
func (s *FailedScheduledUpdateGroupActionRequest) SetScheduledActionName(v string) *FailedScheduledUpdateGroupActionRequest {
	s.ScheduledActionName = &v
	return s
}
182422
func (s *SourceRevision) SetActionName(v string) *SourceRevision {
	s.ActionName = &v
	return s
}