Prepare message to be sent through messaging service.

@return Message to be sent with messaging service.
7353
public MessageToSend prepareMessageToSend() {
        originalMessage.getParts().clear();
        originalMessage.getParts().addAll(publicParts);
        return originalMessage;
    }
602318
private function prepareService()
    {
        /**
         * If CommodeCommonServiceProvider is not loaded yet, load it
         * and mark as registered in GhostServices
         */
        if (!($bound = $this->app->bound(ServiceShortCuts::CORE_INITIALIZED))) {
            $this->services(['LaravelCommode\Common\CommodeCommonServiceProvider']);
        }

        $withGhostServiceDo = function (GhostServices $appServices) use ($bound) {
            /**
             * If CommodeCommonServiceProvider is not loaded yet, load it
             * and mark as registered in GhostServices
             */
            if (!$bound) {
                $appServices->register('LaravelCommode\Common\CommodeCommonServiceProvider');
            }

            /**
             * Get and register service providers in ServiceManager
             */
            $services = $appServices->differUnique($this->uses(), true);

            /**
             * Register service proviers in laravel app
             * differing from already used ones
             */
            $this->services(array_diff($services, array_keys($this->app->getLoadedProviders())));

            /**
             * Mark current service as registered
             */
            $appServices->register(get_class($this));
        };

        $this->with(ServiceShortCuts::GHOST_SERVICE, $withGhostServiceDo);

        return $this;
    }
361792
public ParallelTaskBuilder preparePing() {
        reinitIfClosed();
        ParallelTaskBuilder cb = new ParallelTaskBuilder();
        cb.setProtocol(RequestProtocol.PING);
        return cb;
    }
394902
public function toAndroid()
    {
        $message = [
            'gcm' => [
                'notification' => [
                    'title' => $this->title,
                    'body' => $this->body,
                    'sound' => $this->sound,
                    'icon' => $this->icon,
                ],
            ],
        ];

        $this->formatMessage($message);

        return $message;
    }
136661
public MimeMessage createMimeMessage(Session session) throws MessagingException {
		if (isEmpty(htmlPart) && isEmpty(textPart)) {
			throw new IllegalArgumentException("Missing email content");
		}
		final MimeMessage msg = new MimeMessage(session);
		msg.setSubject(subject);
		msg.setFrom(new InternetAddress(from));
		msg.setContent(createMultiPart());
		msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients, false));
		return msg;
	}
1367333
public MessageMgr build(){
		if(this.messageHandlers.size()==0){
			this.buildErrors.addError("no message handlers set");
			return null;
		}
		return new MessageMgr(this.appID, this.messageHandlers, this.doCollectMessages);
	}
1217730
public MessageDialog build() {
        MessageDialog messageDialog = new MessageDialog(
                title,
                text,
                buttons.toArray(new MessageDialogButton[buttons.size()]));
        messageDialog.setHints(extraWindowHints);
        return messageDialog;
    }
979950
private Message pollPrefetchQueue() {
        final Message message = this.prefetchedMessages.poll();
        if (message != null) {
            // message lastReceivedOffset should be up-to-date upon each poll - as recreateLink will depend on this
            this.lastReceivedMessage = message;
            this.sendFlow(1);
        }

        return message;
    }
409174
private function getMessageInstance() {

		if(null === $this -> messageInstance) {
			$this -> messageInstance = Message :: Instance();
		}

		return $this -> messageInstance;
	}
1283599
private function updateMessage()
    {
        $this->message = $this->_message;

        if (null !== $this->_source && null !== $this->_seek) {
            $this->message .= sprintf(' in %s at %d.', $this->_source, $this->_seek);
        } elseif (null !== $this->_source) {
            $this->message .= sprintf(' : %s.', $this->_source);
        }

        return $this;
    }
288765
public function send()
    {
        // Convert body to hex when the message is binary
        if ($this->isBinary()) {
            $this->postFields['body'] = strtoupper(bin2hex($this->body));
        }

        $response = $this->sendApiCall(self::ACTION_CREATE, $this->getCreateUrl());

        if (!isset($response->getBody()['_embedded']['items'])) {
            throw new Exception('Invalid response returned from server', Exception::INVALID_RESPONSE);
        }

        $result = array();
        foreach ($response->getBody()['_embedded']['items'] as $item) {
            $result[] = $sms = new Sms($this->client, $this->factory);
            $sms->setFields($item);
        }

        return $result;
    }
821305
public function composeMessage()
    {
        // Attempts to make a view.
         // If a view can not be created; it is assumed that simple message is passed through.
        try {
            return $this->views->make($this->view, $this->data)->render();
        } catch (\InvalidArgumentException $e) {
            return $this->view;
        }
    }
698624
protected Map<String, Message.Builder> getMessageMap() {
    return new HashMap<String, Message.Builder>(messageMap);
  }
708654
public function prepare()
    {
        $content = $this->getContent();
        if ($content === null) {
            $this->getFormatter()->format($this);
        } elseif (is_array($content)) {
            $this->prepareMultiPartContent($content);
        }

        $this->isPrepared = true;

        return $this;
    }
441084
public function prepare(){
	
		/*
		Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. 
		http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1
		*/
		
		// Must be a multipart request
		if($this->files->all()){
		
			$boundary = self::generateBoundary();
			
			$this->prepared_body = Request::buildPostBody($this->post->all(), $this->files->all(), $boundary);
			$this->headers->set('content-type', 'multipart/form-data; boundary='.$boundary);
		
		} else if($this->post->all()){
			
			$this->prepared_body = http_build_query($this->post->all());
			$this->headers->set('content-type', 'application/x-www-form-urlencoded');
			
		} else {
		
			$this->headers->set('content-type', $this->detectContentType($this->body));
			$this->prepared_body = $this->body;
		}
		
		/*
		The transfer-length of a message is the length of the message-body as it appears in the message; that is, after any transfer-codings have been applied.
		http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4
		*/
		
		$len = strlen($this->prepared_body);
		
		if($len > 0){
			$this->headers->set('content-length', $len);
		} else {
			$this->headers->remove('content-length');
			$this->headers->remove('content-type');
		}
	}
705600
public function sendSmsToVnmSDPWithSOAP()
    {
        $result = array();
        if ($this->responseIsObject) {
            $result = Utils::arrayToObject($result);
        }
        $this->sendSmsResult = $result;
        $this->logger->info(__FUNCTION__, 'Send SMS Result: ' . json_encode($this->sendSmsResult));

        return $this;
    }
448377
@SuppressLint("ShowToast")
  public Toast build() {
    Toast toast = Toast.makeText(context, message, duration);

    TextView toastMessage = setupToastView(toast);
    setToastMessageTextColor(toastMessage);
    setToastGravity(toast);

    return toast;
  }