// CreateOrGetNotifcation issues the nimbusec API to create the given notification. Instead of
// failing when attempting to create a duplicate notification, this method will fetch the
// remote notification instead.
552825
func (a *API) CreateOrGetNotification(user int, notification *Notification) (*Notification, error) {
	dst := new(Notification)
	url := a.BuildURL("/v2/user/%d/notification", user)
	err := a.Post(url, Params{"upsert": "false"}, notification, dst)
	return dst, err
}
533741
func (handle *ContextHandle) sendNotification() {
	if handle.reloadNotification != nil {
		select {
		case handle.reloadNotification <- struct{}{}:
			logger.Info("Notification sent for recreated pkcs11 ctx")
		default:
			logger.Warn("Unable to send notification for recreated pkcs11 ctx")
		}
	}
}
135223
func CreateOrg(c *context.APIContext, form api.CreateOrgOption) {
	org.CreateOrgForUser(c, form, user.GetUserByParams(c))
}
520643
func (s *SendCommandInput) SetNotificationConfig(v *NotificationConfig) *SendCommandInput {
	s.NotificationConfig = v
	return s
}
1275474
func (s *NotificationsService) Create(k NotificationKey, n NotificationDTO) (*http.Response, error) {
	return s.client.post(k.URI(), n, nil)
}
1187669
func (f *FS) LaunchNotificationProcessor(ctx context.Context) {
	f.notifications.LaunchProcessor(ctx)
}
476265
func (s *CreateClusterInput) SetNotificationTopicArn(v string) *CreateClusterInput {
	s.NotificationTopicArn = &v
	return s
}
808924
func (d *Driver) SendNotification(message string) string {
	d.Messages = append(d.Messages, message)
	return message
}
571333
func (s *notificationServiceImpl) createClientWithContextSigner(ctx context.Context, options ...rest.HTTPClientOption) (*client.Client, error) {
	c, err := s.createClient(options...)
	if err != nil {
		return nil, err
	}
	sgn := signer.NewSATokenSigner(ctx)
	saTokenSigner, err := sgn.Signer()
	if err != nil {
		return nil, err
	}
	c.SetJWTSigner(saTokenSigner)
	return c, nil
}
472984
func (n *CgroupNotifierFactory) NewCgroupNotifier(path, attribute string, threshold int64) (CgroupNotifier, error) {
	return NewCgroupNotifier(path, attribute, threshold)
}
1127802
func (s *AccountTakeoverRiskConfigurationType) SetNotifyConfiguration(v *NotifyConfigurationType) *AccountTakeoverRiskConfigurationType {
	s.NotifyConfiguration = v
	return s
}
270625
func (s *UpdateNotificationSettingsInput) SetNotification(v *NotificationSpecification) *UpdateNotificationSettingsInput {
	s.Notification = v
	return s
}
1021850
func NewNotifier(ec *EngineConfig) (*Notifier, error) {
	outgoing := make(chan Notification, 1)
	n := &Notifier{
		C:         outgoing,
		outgoing:  outgoing,
		reload:    make(chan bool, 1),
		shutdown:  make(chan bool, 1),
		engineCfg: ec,
		source:    SourcePeer,
	}

	note, err := n.bootstrap()
	if err != nil {
		return nil, err
	}

	// If the on disk configuration is different, update it.
	if note.Source != SourceDisk {
		dNote, _ := n.pullConfig(SourceDisk)
		if dNote == nil || !dNote.Cluster.Equal(note.Cluster) {
			if err := saveConfig(note.protobuf, n.engineCfg.ClusterFile, true); err != nil {
				log.Warningf("Failed to save config to %s: %v", n.engineCfg.ClusterFile, err)
			}
		}
	}

	n.last = note
	n.outgoing <- *note

	go n.run()
	return n, nil
}
790609
func (s *CreateNotificationInput) SetNotification(v *Notification) *CreateNotificationInput {
	s.Notification = v
	return s
}
122179
func (s *NotificationWithSubscribers) SetNotification(v *Notification) *NotificationWithSubscribers {
	s.Notification = v
	return s
}
904615
func (s *CreateReplicationGroupInput) SetNotificationTopicArn(v string) *CreateReplicationGroupInput {
	s.NotificationTopicArn = &v
	return s
}
795515
func (c Client) AddNotification(n contract.Notification) (string, error) {
	conn := c.Pool.Get()
	defer conn.Close()

	err := addNotification(conn, &n)
	if err != nil {
		return "", err
	}
	return n.ID, nil
}