Creates and posts an activity to a user.

@param verb
@param title
@param content
@param category
@param user
@param object
@param objectType
@param objectName
@param objectContent
@return
519046
public ApiResponse postUserActivity(String verb, String title,
            String content, String category, User user, Entity object,
            String objectType, String objectName, String objectContent) {
        Activity activity = Activity.newActivity(verb, title, content,
                category, user, object, objectType, objectName, objectContent);
        return postUserActivity(user.getUuid().toString(), activity);
    }
997404
protected function _createRequest(
    ApiPayloadInterface $payload = null, $path = null, $verb = HttpVerb::POST
  )
  {
    return parent::_createRequest($payload, $path, $verb);
  }
1185246
def create_activity(self, data):
        
        url = self._build_url('my', 'activities')
        if isinstance(data, dict):
            data = json.dumps(data)
        r = self.session.post(url, data=data)
        r.raise_for_status()
        return r
354092
public function request($endpoint, $verb = 'GET', $params = [], $data = null)
    {
        $context = $this->getStreamContext($verb);
        if ($data) {
            stream_context_set_option($context, array('http' => array('content' => json_encode($data))));
        }

        $query = http_build_query($params);
        $base = $this->getConfig()->getServer().$endpoint;
        $url = $base;

        if (!empty($query)) {
            $parsed = parse_url($base);
            if (key_exists('query', $parsed) || substr($base, -1) == "?") {
                $url .= '&'.$query;
            } else {
                $url .= '?'.$query;
            }
        }

        $handle = fopen($url, 'r', false, $context);
        if ($handle === false) {
            $e = error_get_last();
            throw new \Exception($e['message'], $e['type']);
        }
        $response = stream_get_contents($handle);
        fclose($handle);

        $response = json_decode($response, true);

        return $response;
    }
907713
public SVCPostSend postSend(List<IbvSendWR> wrList, List<IbvSendWR> badwrList) throws IOException {
		return verbs.postSend(this, wrList, badwrList);
	}
420667
function createActivity(_ref9, activity) {
    var state = _ref9.state,
        commit = _ref9.commit,
        rootState = _ref9.rootState;
    return makeRequest(commit, rootState.c3s.client.apis.Activities.create_activity, {
      activity: activity
    }, 'c3s/activity/SET_ACTIVITY');
  }
22196
public boolean addContextToVerb(String objectType, String id, String description)
    {
        Map<String, Object> container = new HashMap<String, Object>();
        
        if (objectType != null)
        {
            container.put("objectType", objectType);
        }
        if (id != null)
        {
            container.put("id", id);
        }
        if (description != null)
        {
            container.put("description", description);
        }
        
        String[] pathKeys = {"verb"};
        return addChild("context", container, pathKeys);
    }
539386
public final Post withAuthor(final User user) {
      return new Post(id, slug, title, excerpt, content, authorId, user,
              publishTimestamp, modifiedTimestamp, status, parentId,
              guid, commentCount, metadata, type, mimeType, taxonomyTerms, children);
   }
990954
@Override
    public void doPost(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws ServletException, IOException {
        CallFuture<NaviRpcResponse> callFuture = new CallFuture<NaviRpcResponse>();
        try {
            NaviRpcExporter serviceExporter = getRpcExporter(httpRequest);
            String protocol = getProtocolByHttpContentType(httpRequest);
            LocalContext.getContext().setStartTime().setProtocol(protocol)
                    .setFromIp(IPUtils.getIpAddr(httpRequest))
                    .setServiceName(serviceExporter.getName());

            byte[] byteArray = ByteUtil.readStream(httpRequest.getInputStream(),
                    httpRequest.getContentLength());
            LocalContext.getContext().setReqByteSize(byteArray.length);

            NaviRpcRequest request = new NaviRpcRequest(serviceExporter, byteArray);
            processor.service(request, callFuture);
        } catch (InvalidRequestException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
        } catch (InvalidProtocolException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_ACCEPTABLE);
        } catch (ServiceNotFoundException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_FOUND);
        } catch (CodecException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
            callFuture.cancel(true);
        } catch (DeserilizeNullException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
        } catch (MethodNotFoundException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_FOUND);
        } catch (ServerErrorException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
        } catch (Exception e) {
            callFuture.cancel(true);
            LOG.error(e.getMessage(), e);
            httpResponse.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
        } finally {
            try {
                buildHttpResponse(httpResponse, callFuture.get(), httpRequest.getContentType(),
                        httpRequest.getCharacterEncoding());
            } catch (InterruptedException e2) {
                LOG.error(e2.getMessage(), e2);
            }
            LocalContext.removeContext();
        }
    }
1200810
def log(self, user, content, message):
        
        return self.create(
            user=user,
            content_type=ContentType.objects.get_for_model(content),
            object_id=content.pk,
            change_message=message
        )
109287
def _verb(self, verb):
        

        activity = {
            "verb": verb,
            "object": {
                "id": self.id,
                "objectType": self.object_type,
            }
        }

        self._post_activity(activity)
577533
def create_post(self, title, body, board, category, username):
    '''

    '''

    category_url = "%s/categories.json" % board
    response = requests.get(category_url)

    if response.status_code != 200:
        print('Error with retrieving %s' % category_url)
        sys.exit(1)

    # Get a list of all categories
    categories = response.json()['category_list']['categories']
    categories = {c['name']:c['id'] for c in categories}

    # And if not valid, warn the user
    if category not in categories:
        bot.warning('%s is not valid, will use default' % category)

    category_id = categories.get(category, None)

    headers = {"Content-Type": "application/json",
               "User-Api-Client-Id": self.client_id,
               "User-Api-Key": self.token }


    # First get the category ids
    data = {'title': title,
            'raw': body,
            'category': category_id}

    response = requests.post("%s/posts.json" % board,
                             headers=headers,
                             data=json.dumps(data))

    if response.status_code in [200, 201, 202]:
        topic = response.json()
        url = "%s/t/%s/%s" %(board, topic['topic_slug'], topic['topic_id'])
        bot.info(url)
        return url

    elif response.status_code == 404:
        bot.error('Cannot post to board, not found. Do you have permission?')
        sys.exit(1)

    else:
        bot.error('Cannot post to board %s' % board)
        bot.error(response.content)
        sys.exit(1)
191749
def action_handler(verb, **kwargs):
    
    kwargs.pop('signal', None)
    actor = kwargs.pop('sender')

    # We must store the unstranslated string
    # If verb is an ugettext_lazyed string, fetch the original string
    if hasattr(verb, '_proxy____args'):
        verb = verb._proxy____args[0]

    newaction = apps.get_model('actstream', 'action')(
        actor_content_type=ContentType.objects.get_for_model(actor),
        actor_object_id=actor.pk,
        verb=text_type(verb),
        public=bool(kwargs.pop('public', True)),
        description=kwargs.pop('description', None),
        timestamp=kwargs.pop('timestamp', now())
    )

    for opt in ('target', 'action_object'):
        obj = kwargs.pop(opt, None)
        if obj is not None:
            check(obj)
            setattr(newaction, '%s_object_id' % opt, obj.pk)
            setattr(newaction, '%s_content_type' % opt,
                    ContentType.objects.get_for_model(obj))
    if settings.USE_JSONFIELD and len(kwargs):
        newaction.data = kwargs
    newaction.save(force_insert=True)
    return newaction
370054
public void updateChangeLog(final Principal user, final Verb verb, final PropertyKey key, final Object previousValue, final Object newValue) {

		if ((Settings.ChangelogEnabled.getValue() || Settings.UserChangelogEnabled.getValue()) && key != null) {

			final String name = key.jsonName();

			if (!hiddenPropertiesInAuditLog.contains(name) && !(key.isUnvalidated() || key.isReadOnly())) {

				final JsonObject obj = new JsonObject();

				obj.add("time",     toElement(System.currentTimeMillis()));
				obj.add("userId",   toElement(user.getUuid()));
				obj.add("userName", toElement(user.getName()));
				obj.add("verb",     toElement(verb));
				obj.add("key",      toElement(key.jsonName()));
				obj.add("prev",     toElement(previousValue));
				obj.add("val",      toElement(newValue));

				if (Settings.ChangelogEnabled.getValue()) {
					changeLog.append(obj.toString());
					changeLog.append("\n");
				}

				if (Settings.UserChangelogEnabled.getValue()) {

					// remove user for user-centric logging to reduce redundancy
					obj.remove("userId");
					obj.remove("userName");

					// add target to identify change event
					obj.add("target", toElement(getUuid()));

					appendUserChangelog(user.getUuid(), obj.toString());
				}
			}
		}
	}
909798
function(messageContent) {
                /**
                 * + User                     {object}
                 *    - id                    {long}
                 *    - name                  {string}
                 *    - email                 {string}
                 *    - cellphoneNumber       {string}
                 *    - image                 {string}
                 *    - lastSeen              {long}
                 *    - sendEnable            {boolean}
                 *    - receiveEnable         {boolean}
                 */

                var user = {
                    id: messageContent.id,
                    name: messageContent.name,
                    email: messageContent.email,
                    cellphoneNumber: messageContent.cellphoneNumber,
                    image: messageContent.image,
                    lastSeen: messageContent.lastSeen,
                    sendEnable: messageContent.sendEnable,
                    receiveEnable: messageContent.receiveEnable
                };

                return user;
            }
924526
function makeHelper(obj, verb) {
  obj[verb] = function helper(url, options, f) {
    // ('url')
    if(_.isString(url)){
      // ('url', f)
      if(_.isFunction(options)){
        f = options;
      }

      if(!_.isObject(options)){
        options = {};
      }

      // ('url', {object})
      options.url = url;
    }

    if(_.isObject(url)){
      if(_.isFunction(options)){
        f = options;
      }
      options = url;
    }

    options.method = verb.toUpperCase();
    return obj(options, f);
  };
}
794398
private void writeUser(User user, Node node) throws Exception
   {
      node.setProperty(UserProperties.JOS_EMAIL, user.getEmail());
      node.setProperty(UserProperties.JOS_FIRST_NAME, user.getFirstName());
      node.setProperty(UserProperties.JOS_LAST_NAME, user.getLastName());
      node.setProperty(UserProperties.JOS_PASSWORD, user.getPassword());
      node.setProperty(UserProperties.JOS_DISPLAY_NAME, user.getDisplayName());
      node.setProperty(UserProperties.JOS_USER_NAME, node.getName());

      Calendar calendar = Calendar.getInstance();
      calendar.setTime(user.getCreatedDate());
      node.setProperty(UserProperties.JOS_CREATED_DATE, calendar);
   }