Creates default alert as in {@link #create(AlertType, String)} with dismiss functionality.
192698
public static AlertBean createDismissible(AlertType type, String message) {
        final AlertBean result = create(type, message);
        result.setDismissible(true);
        return result;
    }
1059725
def create(self, term, options):
        """"""
        if not self._state:
            raise InvalidState("State was not properly obtained from the app")
        options['action'] = 'CREATE'
        payload = self._build_payload(term, options)
        url = self.ALERTS_CREATE_URL.format(requestX=self._state[3])
        self._log.debug("Creating alert using: %s" % url)
        params = json.dumps(payload, separators=(',', ':'))
        data = {'params': params}
        response = self._session.post(url, data=data, headers=self.HEADERS)
        if response.status_code != 200:
            raise ActionError("Failed to create monitor: %s"
                              % response.content)
        if options.get('exact', False):
            term = "\"%s\"" % term
        return self.list(term)
1026792
private Event newEvent(final String id, final Exception error) {
        return new EventFactorySupport().event(this, id, new LocalAttributeMap<>("error", error));
    }
153306
public Optional<AlertCondition> create(long policyId, AlertCondition condition)
    {
        return HTTP.POST(String.format("/v2/alerts_conditions/policies/%d.json", policyId), condition, ALERT_CONDITION);
    }
860090
private Activation createActivation()
    {
        Activation activation = new Activation();
        activation.setActiveByDefault( false );
        activation.setOs( createOsBean() );
        return activation;
    }
1242416
public function createAlerts()
    {
        $alerts = new Alerts();

        $this->createNotifier($alerts);

        $this->createFlashNotifier($alerts);

        $alerts->setDefaultNotifier(isset(static::$config['default']) ? static::$config['default'] : 'flash');

        return $alerts;
    }
491478
private static String createMessage(final ThresholdAlert alert, final String template) {
        // TODO: message should be encoded to apropriate encoding
        //return alert.getThreshold().getName() + ": " + alert.getOldStatus() + "->" + alert.getNewStatus();
        String message;
        if(!StringUtils.isEmpty(template)) {
            ThresholdAlertTemplate thresholdAlertTemplate = new ThresholdAlertTemplate(alert);
            message = thresholdAlertTemplate.process(template);
        } else {
            message = ThresholdAlertConverter.toPlainText(alert);
        }
        return message;
    }
325483
private OnClickListener createDialogPreferenceClickListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final DialogInterface dialog, final int which) {
                String button = getString(
                        which == DialogInterface.BUTTON_POSITIVE ? android.R.string.ok :
                                android.R.string.cancel);
                String text = String.format(getString(R.string.dialog_dismissed_toast), button);
                Toast.makeText(getActivity(), text, Toast.LENGTH_SHORT).show();
            }

        };
    }
873011
@Override
    public void alertISClose() {
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME,"alertISClose()", "");
        }
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        
        if (_srtRequestHelper != null)
            _srtRequestHelper._InputStreamClosed=true; 
    }
620875
public void alertClose() {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"alertClose", " _outWriter: --> " + _outWriter);
        // 104771
        writerClosed = true;

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"alertClose", "exit");
    }
859090
public static AuditEventType create(@Nonnull String type) {
        if (isNullOrEmpty(type)) {
            throw new IllegalArgumentException(ARGUMENT_ERROR + type);
        }

        final List<String> strings = SPLITTER.splitToList(type);

        if (strings.size() < 3) {
            throw new IllegalArgumentException(ARGUMENT_ERROR + type);
        }

        final String namespace = strings.get(0);
        final String object = strings.get(1);
        final String action = strings.get(2);

        if (isNullOrEmpty(namespace) || isNullOrEmpty(object) || isNullOrEmpty(action)) {
            throw new IllegalArgumentException(ARGUMENT_ERROR + type);
        }
        return create(namespace, object, action);
    }
855421
def create_alert(self, alert):

        

        req = self.url + "/api/alert"
        data = alert.jsonify()
        try:
            return requests.post(req, headers={'Content-Type': 'application/json'}, data=data, proxies=self.proxies, auth=self.auth, verify=self.cert)
        except requests.exceptions.RequestException as e:
            raise AlertException("Alert create error: {}".format(e))
381346
function createCloseEvent(config) {
  const { code, reason, type, target } = config;
  let { wasClean } = config;

  if (!wasClean) {
    wasClean = code === 1000;
  }

  const closeEvent = new CloseEvent(type, {
    code,
    reason,
    wasClean
  });

  if (target) {
    closeEvent.target = target;
    closeEvent.srcElement = target;
    closeEvent.currentTarget = target;
  }

  return closeEvent;
}
997221
private OnClickListener createPositiveButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                Toast.makeText(getActivity(), R.string.positive_button_toast, Toast.LENGTH_SHORT)
                        .show();
            }

        };
    }
419491
public static AlertDto transformToDto(Alert alert) {
        if (alert == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        AlertDto result = createDtoObject(AlertDto.class, alert);

        result.setOwnerName(alert.getOwner().getUserName());
        for (Trigger trigger : alert.getTriggers()) {
            result.addTriggersIds(trigger);
        }
        for (Notification notification : alert.getNotifications()) {
            result.addNotificationsIds(notification);
        }
        return result;
    }
73083
def alertView(alertView, didDismissWithButtonIndex:buttonIndex)
      @view_controller.dismissViewControllerAnimated @opts[:animated], completion: nil
      action = @actions_in_display_order[buttonIndex]
      action.handler.call(action.tag, @text_fields) if action.handler
      @view_controller = nil # forget the reference
    end
221040
public static ErrorDescription create(ApplicationException ex) {
    	ErrorDescription description = new ErrorDescription();
    	description.setCategory(ex.getCategory());
    	description.setStatus(ex.getStatus());
    	description.setCode(ex.getCode());
    	description.setMessage(ex.getMessage());
    	description.setDetails(ex.getDetails());
    	description.setCorrelationId(ex.getCorrelationId());    	
    	description.setCause(ex.getCauseString());    	
    	description.setStackTrace(ex.getStackTraceString());    	
    	return description;
    }