Create successfully result

@param Phone  $phone
@param string $messageId

@return Result
968304
public static function successfully(Phone $phone, string $messageId = null): Result
    {
        return new self($phone, true, $messageId);
    }
1331880
public MessageId newMessageId() {
        /*
         * use database sequence convert into hex representation or if not using
         * database using random
         */
        try {
            synchronized (random) {
                return new MessageId(Integer.toString(random.nextInt(Integer.MAX_VALUE), 16));
            }
        } catch (PDUStringException e) {
            throw new RuntimeException("Failed creating message id", e);
        }
    }
1079436
public A messageId(String messageId) {
        this.headers.add(Pair.of("X-MessageId", messageId));
        return (A)this;
    }
520820
public function create( models\Call\ContactNumber $ContactNumber){
        $rest = $this->getService( self::API_NUMBER);
        $rest->POST( $ContactNumber);

        return $rest->getResult( models\Call\ContactNumber::class);
    }
157798
public JsJmsMessage createJmsMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsMessage");
    JsJmsMessage msg = null;
    try {
      msg = new JsJmsMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsMessage");
    return msg;
  }
640182
public static function create($host, $port, $password)
    {
        $connection = ConnectionFactory::create($host, $port, $password);

        return new Messenger($connection);
    }
967754
public function getCollectorMessage($collectorId, $messageId)
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('collectors/%s/messages/%s', $collectorId, $messageId))
		);
	}
1268923
public function readMessage($messageId = null)
    {
        if (!is_null($messageId)) {
            $message = $this->message->with(['sender', 'conversation'])->find($messageId);

            if ($message->coversation->user_one == $this->authUserId || $message->coversation->user_two == $this->authUserId) {
                return $message;
            }
        }

        return false;
    }
35651
public function setMessage($messageString, $messageKey = null)
    {
        if ($messageKey === null) {
            $keys = array_keys($this->_messageTemplates);
            foreach($keys as $key) {
                $this->setMessage($messageString, $key);
            }
            return $this;
        }

        if (!isset($this->_messageTemplates[$messageKey])) {
            require_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception("No message template exists for key '$messageKey'");
        }

        $this->_messageTemplates[$messageKey] = $messageString;
        return $this;
    }
1370505
public function delete($boxId, $messageId, $documentId = null)
    {
        $this->doRequest(
            self::RESOURCE_DELETE,
            [
                'boxId' =>  $boxId,
                'messageId' => $messageId,
                'documentId' => $documentId
            ],
            self::METHOD_POST
        );

        return true;
    }
577023
public function getTokenResult($messageId, $token)
    {
        $verification = $this->factory->createEmptyVerification();
        $verification->verify($token, $messageId);

        return $verification;
    }
281266
public function getMessage($messageId)
    {
        $this->buildCall('/incoming-messages');
        $this->buildCall('/'.$messageId);

        $rawMessage = $this->getRequest()->json();

        return $this->makeMessage($rawMessage['Response']['Entry']);
    }
415510
public function create(int $conversationId, int $threadId, Attachment $attachment): ?int
    {
        return $this->restClient->createResource(
            $attachment,
            sprintf('/v2/conversations/%d/threads/%d/attachments', $conversationId, $threadId)
        );
    }
609459
public function MarkMessageRead($messageId, $accessToken = null)
    {
        return $this->provider->executeRequest("POST", "/message/{$messageId}", $accessToken ?: $this->accessToken);
    }
942169
public function getMessage($messageId)
    {
        $this->buildCall('/get-sms-status/'.$messageId);

        return $this->makeMessage(json_decode($this->getRequest()->getBody()->getContents()));
    }
1018518
public final ControlCreateDurable createNewControlCreateDurable() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlCreateDurable");
    ControlCreateDurable msg = null;
    try {
      msg = new ControlCreateDurableImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewControlCreateDurable");
    return msg;
  }
644912
public static function createForMessage($recipientOrPhone, Message $message, $notificationType = NotificationType::REGULAR, $messagingType = MessagingType::RESPONSE)
    {
        $options = [];
        $data = [
            'messaging_type' => $messagingType,
            'recipient' => self::createRecipientField($recipientOrPhone),
            'message' => $message,
            'notification_type' => $notificationType,
        ];
        
        if ($message->hasFileToUpload()) {

            // Create a multipart request
            $options[RequestOptions::MULTIPART] = [
                [
                  'name' => 'messaging_type',
                  'contents' => $messagingType
                ],
                [
                    'name' => 'recipient',
                    'contents' => json_encode($data['recipient']),
                ],
                [
                    'name' => 'message',
                    'contents' => json_encode($data['message']),
                ],
                [
                    'name' => 'notification_type',
                    'contents' => $data['notification_type'],
                ],
                [
                    'name' => 'filedata',
                    'contents' => $message->getFileStream(),
                ],
            ];

            // Update timeout if we upload a file
            $options['timeout'] = Client::DEFAULT_FILE_UPLOAD_TIMEOUT;

            return $options;
        }

        $options[RequestOptions::JSON] = $data;

        return $options;
    }