// AlertV2 instantiates a new OpsGenieAlertV2Client.
431737
func (cli *OpsGenieClient) AlertV2() (*OpsGenieAlertV2Client, error) {
	cli.makeHTTPTransportSettings()

	alertClient := new(OpsGenieAlertV2Client)
	alertClient.SetOpsGenieClient(*cli)

	if cli.opsGenieAPIURL == "" {
		alertClient.SetOpsGenieAPIUrl(endpointURL)
	}

	return alertClient, nil
}
569926
func (s *AlertService) NewGenerateAlertParams(description string, name string, alertType int) *GenerateAlertParams {
	p := &GenerateAlertParams{}
	p.p = make(map[string]interface{})
	p.p["description"] = description
	p.p["name"] = name
	p.p["type"] = alertType
	return p
}
1364191
func DefaultAlertConfig() *ConsulAlertConfig {

	checks := &ChecksConfig{
		Enabled:         true,
		ChangeThreshold: 60,
	}

	events := &EventsConfig{
		Enabled:  true,
		Handlers: []string{},
	}

	email := &notifier.EmailNotifier{
		ClusterName: "Consul-Alerts",
		Enabled:     false,
		SenderAlias: "Consul Alerts",
		Receivers:   []string{},
	}

	log := &notifier.LogNotifier{
		Enabled: true,
		Path:    "/tmp/consul-notifications.log",
	}

	influxdb := &notifier.InfluxdbNotifier{
		Enabled:    false,
		SeriesName: "consul-alerts",
	}

	slack := &notifier.SlackNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	mattermost := &notifier.MattermostNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	mattermostWebhook := &notifier.MattermostWebhookNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	pagerduty := &notifier.PagerDutyNotifier{
		Enabled: false,
	}

	hipchat := &notifier.HipChatNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	opsgenie := &notifier.OpsGenieNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	awsSns := &notifier.AwsSnsNotifier{
		Enabled:     false,
		ClusterName: "Consul-Alerts",
	}

	victorOps := &notifier.VictorOpsNotifier{
		Enabled: false,
	}

	ilert := &notifier.ILertNotifier{
		Enabled:             false,
		IncidentKeyTemplate: "{{.Node}}:{{.Service}}:{{.Check}}",
	}

	notifiers := &notifier.Notifiers{
		Email:             email,
		Log:               log,
		Influxdb:          influxdb,
		Slack:             slack,
		Mattermost:        mattermost,
		MattermostWebhook: mattermostWebhook,
		PagerDuty:         pagerduty,
		HipChat:           hipchat,
		OpsGenie:          opsgenie,
		AwsSns:            awsSns,
		VictorOps:         victorOps,
		ILert:             ilert,
		Custom:            []string{},
	}

	return &ConsulAlertConfig{
		Checks:    checks,
		Events:    events,
		Notifiers: notifiers,
	}
}
103334
func (o *OIDCConnectorV1) V2() *OIDCConnectorV2 {
	return &OIDCConnectorV2{
		Kind:    KindOIDCConnector,
		Version: V2,
		Metadata: Metadata{
			Name: o.ID,
		},
		Spec: OIDCConnectorSpecV2{
			IssuerURL:     o.IssuerURL,
			ClientID:      o.ClientID,
			ClientSecret:  o.ClientSecret,
			RedirectURL:   o.RedirectURL,
			Display:       o.Display,
			Scope:         o.Scope,
			ClaimsToRoles: o.ClaimsToRoles,
		},
	}
}
263684
func (a *InputAnnotation) ToV2() *trace.Annotation {
	return &trace.Annotation{
		Timestamp: GetPointerToInt64(a.Timestamp),
		Value:     a.Value,
	}
}
953004
func Alert(title, message, appIcon string) error {
	if err := Notify(title, message, appIcon); err != nil {
		return err
	}
	return Beep(DefaultFreq, DefaultDuration)
}
1350065
func updateServiceWeightsV2(key ServiceKeyV2, value *RRSeqValue) error {
	if _, err := key.RRMap().OpenOrCreate(); err != nil {
		return err
	}

	return key.RRMap().Update(key.ToNetwork(), value)
}
667238
func (c *Client) DeleteAlert(ctx context.Context, id string) (bool, error) {
	path := fmt.Sprintf(alertDeletePath, id)

	req, err := c.NewRequest("DELETE", path, nil, nil)
	if err != nil {
		return false, err
	}

	if err := c.Do(ctx, req, nil); err != nil {
		return false, err
	}

	return true, nil
}
872936
func alert(pages *tview.Pages, id string, message string) *tview.Pages {
	return pages.AddPage(
		id,
		tview.NewModal().
			SetText(message).
			AddButtons([]string{"确定"}).
			SetDoneFunc(func(buttonIndex int, buttonLabel string) {
				pages.HidePage(id).RemovePage(id)
			}),
		false,
		true,
	)
}
164587
func (l *Logger) Alertf(format string, va ...interface{}) error {
	return l.logMsg(nil, LEVEL_ALERT, format, va...)
}
217737
func NewAlertFromPayload(serializedPayload []byte, pver uint32) (*Alert, error) {
	var alert Alert
	r := bytes.NewReader(serializedPayload)
	err := alert.Deserialize(r, pver)
	if err != nil {
		return nil, err
	}
	return &alert, nil
}
248002
func InvOp2(x, y interface{}, o opcode.Op) (interface{}, error) {
	return nil, errors.Errorf("Invalid operation: %v %v %v (mismatched types %T and %T)", x, o, y, x, y)
}
1227119
func HTTP2(enabled bool) func(*Attacker) {
	return func(a *Attacker) {
		if tr := a.client.Transport.(*http.Transport); enabled {
			http2.ConfigureTransport(tr)
		} else {
			tr.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{}
		}
	}
}
853440
func (c *Client) CreateAlert(projectName string, alertRequest AlertRequest) (result ResultModel, err error) {
	postObjContent, _ := json.Marshal(alertRequest)
	postJson := string(postObjContent)

	requestUrl := c.GetUrl(entity, projectName, "")
	requestPath := GetRequestPath(entity, projectName, "")

	responseResult, err := c.GetResponseJson("POST", requestUrl, requestPath, postJson)

	if err != nil {
		return result, err
	}

	err = json.Unmarshal([]byte(responseResult), &result)

	return result, err
}
325708
func (s *AlertService) GetAlertID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListAlertsParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListAlerts(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", name, l)
	}

	if l.Count == 1 {
		return l.Alerts[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.Alerts {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
558025
func Alert(message string, fields ...interface{}) uint64 {
	return DefaultLogger().Event(event.Alert, message, fields...)
}
1042048
func (c ConfigClient) GetUpdateInfo2(ctx context.Context, __arg GetUpdateInfo2Arg) (res UpdateInfo2, err error) {
	err = c.Cli.Call(ctx, "keybase.1.config.getUpdateInfo2", []interface{}{__arg}, &res)
	return
}