// GetAction returns the Action field if it's non-nil, zero value otherwise.
766540
func (m *MilestoneEvent) GetAction() string {
	if m == nil || m.Action == nil {
		return ""
	}
	return *m.Action
}
340842
func (s *RegexMatchSetUpdate) SetAction(v string) *RegexMatchSetUpdate {
	s.Action = &v
	return s
}
1158729
func (p *PullRequestReviewEvent) GetAction() string {
	if p == nil || p.Action == nil {
		return ""
	}
	return *p.Action
}
852841
func NewActionGetCommand(ctx Context) (cmd.Command, error) {
	return &ActionGetCommand{ctx: ctx}, nil
}
219828
func (u *Unit) AddAction(name string, payload map[string]interface{}) (Action, error) {
	if len(name) == 0 {
		return nil, errors.New("no action name given")
	}

	// If the action is predefined inside juju, get spec from map
	spec, ok := actions.PredefinedActionsSpec[name]
	if !ok {
		specs, err := u.ActionSpecs()
		if err != nil {
			return nil, err
		}
		spec, ok = specs[name]
		if !ok {
			return nil, errors.Errorf("action %q not defined on unit %q", name, u.Name())
		}
	}
	// Reject bad payloads before attempting to insert defaults.
	err := spec.ValidateParams(payload)
	if err != nil {
		return nil, err
	}
	payloadWithDefaults, err := spec.InsertDefaults(payload)
	if err != nil {
		return nil, err
	}

	m, err := u.st.Model()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return m.EnqueueAction(u.Tag(), name, payloadWithDefaults)
}
449383
func (p *ProjectColumnEvent) GetAction() string {
	if p == nil || p.Action == nil {
		return ""
	}
	return *p.Action
}
794105
func (s *StepExecution) SetAction(v string) *StepExecution {
	s.Action = &v
	return s
}
654094
func (i *IssuesEvent) GetAction() string {
	if i == nil || i.Action == nil {
		return ""
	}
	return *i.Action
}
21244
func (qrs *Rules) GetAction(ip, user string, bindVars map[string]*querypb.BindVariable) (action Action, desc string) {
	for _, qr := range qrs.rules {
		if act := qr.GetAction(ip, user, bindVars); act != QRContinue {
			return act, qr.Description
		}
	}
	return QRContinue, ""
}
244602
func (p *PullRequestEvent) GetAction() string {
	if p == nil || p.Action == nil {
		return ""
	}
	return *p.Action
}
861501
func DefaultAction(cmdName string) Action {
	return func(a Flags) error { Printf(errNoAction, cmdName); return nil }
}
807633
func (st *state) GetRebootAction() (params.RebootAction, error) {
	var results params.RebootActionResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: st.machineTag.String()}},
	}

	err := st.facade.FacadeCall("GetRebootAction", args, &results)
	if err != nil {
		return params.ShouldDoNothing, err
	}
	if len(results.Results) != 1 {
		return params.ShouldDoNothing, errors.Errorf("expected 1 result, got %d", len(results.Results))
	}

	if results.Results[0].Error != nil {
		return params.ShouldDoNothing, errors.Trace(results.Results[0].Error)
	}

	return results.Results[0].Result, nil
}
1333100
func (m *MembershipEvent) GetAction() string {
	if m == nil || m.Action == nil {
		return ""
	}
	return *m.Action
}
210602
func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error) {
	path := fmt.Sprintf("cards/%s/actions", c.ID)
	err = c.client.Get(path, args, &actions)
	return
}
1065456
func (c *Client) Action(tag names.ActionTag) (*Action, error) {
	result, err := c.getOneAction(tag)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &Action{
		name:   result.Action.Name,
		params: result.Action.Parameters,
	}, nil
}
2391
func Action(a func(*cli.Context)) Option {
	return func(o *Options) {
		o.Action = a
	}
}
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)
}