Create a comment

@link https://developer.github.com/v3/pulls/comments/#create-a-comment

@param int    $number
@param string $body
@param string $commitId
@param string $path
@param int    $position

@return array
@throws \Exception
14968
public function createComment(int $number, string $body, string $commitId, string $path, int $position): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/:number/comments',
            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number), Request::METHOD_POST, [
                'body'      => $body,
                'commit_id' => $commitId,
                'path'      => $path,
                'position'  => $position
            ]);
    }
25857
public void postComment(int id, int rating, String comment) {
        ClientResource resource = new ClientResource(Route.ADD_COMMENT.url(id));
        resource.setChallengeResponse(this.auth.toChallenge());

        Form form = new Form();
        if (id > 0)
            form.add("rating", String.valueOf(rating));
        if (comment != null && comment.length() > 0)
            form.add("comment", comment);

        resource.post(form);
    }
1032455
public void comment(char[] ch, int start, int length)
        throws SAXException     {
        String commentText = new String(ch, start, length);
        trace("comment:" + commentText);
        Comment comment = currentDocument.createComment(commentText);
        appendNode(comment);
    }
594885
public static function instance($postId, $title, $body, Author $author, array $comments)
    {
        $post = new self();

        $post->postId   = $postId;
        $post->title    = $title;
        $post->body     = $body;
        $post->author   = $author;
        $post->comments = $comments;

        return $post;
    }
393735
public function addComment($orderIncrementId, $status, $comment = null, $notify = null)
    {
        return $this->__createAction('salesOrderAddComment', func_get_args());
    }
1337410
public function editComment(string $gistId, int $id, string $body): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id),
            Request::METHOD_PATCH, [
                'body' => $body
            ]);
    }
795323
function send_comment( $id , $comment , $comment_ori = 0)
	{
		$params = array();
		$params['comment'] = $comment;
		$this->id_format($id);
		$params['id'] = $id;
		$params['comment_ori'] = $comment_ori;
		return $this->oauth->post( 'comments/create', $params );
	}
819288
public function insert($activityId, Google_Service_PlusDomains_Comment $postBody, $optParams = array())
  {
    $params = array('activityId' => $activityId, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('insert', array($params), "Google_Service_PlusDomains_Comment");
  }
327311
public function addComment($creditmemoIncrementId, $comment = null, $notifyCustomer = null, $includeComment = null)
    {
        return $this->__createAction('order_creditmemo.addComment', func_get_args());
    }
905289
public function ProfileController_Comments_Create($Sender, $UserReference = '', $Username = '', $Page = '', $UserID = '') {
		$Sender->EditMode(FALSE);
		$View = $Sender->View;
      // Tell the ProfileController what tab to load
		$Sender->GetUserInfo($UserReference, $Username, $UserID);
      $Sender->_SetBreadcrumbs(T('Comments'), UserUrl($Sender->User, '', 'comments'));
      $Sender->SetTabView('Comments', 'profile', 'Discussion', 'Vanilla');
      
      $PageSize = Gdn::Config('Vanilla.Discussions.PerPage', 30);
      list($Offset, $Limit) = OffsetLimit($Page, $PageSize);
      
      $CommentModel = new CommentModel();
      $Comments = $CommentModel->GetByUser2($Sender->User->UserID, $Limit, $Offset, $Sender->Request->Get('lid'));
      $TotalRecords = $Offset + $CommentModel->LastCommentCount + 1;
      
      // Build a pager
      $PagerFactory = new Gdn_PagerFactory();
      $Sender->Pager = $PagerFactory->GetPager('MorePager', $Sender);
      $Sender->Pager->MoreCode = 'More Comments';
      $Sender->Pager->LessCode = 'Newer Comments';
      $Sender->Pager->ClientID = 'Pager';
      $Sender->Pager->Configure(
         $Offset,
         $Limit,
         $TotalRecords,
         UserUrl($Sender->User, '', 'comments').'?page={Page}' //?lid='.$CommentModel->LastCommentID
      );
      
      // Deliver JSON data if necessary
      if ($Sender->DeliveryType() != DELIVERY_TYPE_ALL && $Offset > 0) {
         $Sender->SetJson('LessRow', $Sender->Pager->ToString('less'));
         $Sender->SetJson('MoreRow', $Sender->Pager->ToString('more'));
         $Sender->View = 'profilecomments';
      }
		$Sender->SetData('Comments', $Comments);
      
      // Set the HandlerType back to normal on the profilecontroller so that it fetches it's own views
      $Sender->HandlerType = HANDLER_TYPE_NORMAL;
      
      // Do not show discussion options
      $Sender->ShowOptions = FALSE;
      
      if ($Sender->Head) {
         $Sender->Head->AddTag('meta', array('name' => 'robots', 'content' => 'noindex,noarchive'));
      }
      
      // Render the ProfileController
      $Sender->Render();
   }
1242251
public static function instance($commentId, $body, Author $author)
    {
        $comment = new self();

        $comment->commentId = $commentId;
        $comment->body      = $body;
        $comment->author    = $author;

        return $comment;
    }
76757
public function editComment($owner, $repo, $id, $body)
	{
		$data = array();
		$data['body'] = $body;

		return $this->client->request("/repos/$owner/$repo/issues/comments/$id", 'PATCH', json_encode($data), 200, 'GitHubIssueComment');
	}
891115
public function create($gistId, $body)
	{
		// Build the request path.
		$path = '/gists/' . (int) $gistId . '/comments';

		// Build the request data.
		$data = json_encode(
			array(
				'body' => $body,
			)
		);

		// Send the request.
		return $this->processResponse($this->client->post($this->fetchUrl($path), $data), 201);
	}
1041416
function createComment(_ref5, cmt) {
    var state = _ref5.state,
        commit = _ref5.commit,
        rootState = _ref5.rootState;
    return makeRequest(commit, rootState.c3s.client.apis.Comments.create_comment, {
      comment: cmt
    }, 'c3s/comments/ADD_COMMENT');
  }
209299
public function insert($activityId, Google_Comment $postBody, $optParams = array()) {
      $params = array('activityId' => $activityId, 'postBody' => $postBody);
      $params = array_merge($params, $optParams);
      $data = $this->__call('insert', array($params));
      if ($this->useObjects()) {
        return new Google_Comment($data);
      } else {
        return $data;
      }
    }
121944
protected function createNode(NodeInterface $commentCollection, CommentDtoInterface $comment): NodeInterface
    {
        $commentNodeType = $this->nodeTypeManager->getNodeType(self::COMMENT_NODE_TYPE);
        $commentNodeTemplate = new NodeTemplate();
        $commentNodeTemplate->setNodeType($commentNodeType);

        $commentNode = $commentCollection->createNodeFromTemplate($commentNodeTemplate);
        $commentNode->setProperty('name', $comment->getName());
        $commentNode->setProperty('email', $comment->getEmail());
        $commentNode->setProperty('content', $comment->getContent());
        $commentNode->setProperty('createdAt', $comment->getCreatedAt());
        $commentNode->setHidden($comment->isHidden());

        if ($this->addCommentToTop) {
            $firstComment = $commentCollection->getChildNodes(null, 1);
            
            if ($firstComment) {
                $commentNode->moveBefore($firstComment[0]);
            }
        }

        return $commentNode;
    }
150367
public function commentList($msg_data_id, $begin, $count, $type, $index = null) {
        if ($count > 50) {
            $count = 50;
        }
        $args = $this->getCommentList()->parameters(
            compact('msg_data_id', 'begin', 'count', 'type', 'index'))->json();
        if ($args['errcode'] != 0) {
            throw new Exception($args['errmsg']);
        }
        return $args;
    }