Create bio voice registration for the supplied recipient

@param string      $recipient
@param string|null $language
@param string|null $webHook

@return BioVoiceRegistration
778527
public function createBioVoiceRegistration($recipient, $language = null, $webHook = null)
    {
        $bioVoiceRegistration = $this->factory->createBioVoiceRegistration($recipient, $language, $webHook);

        return $bioVoiceRegistration;
    }
1140873
public function addRecipient(JWK $recipientKey, array $recipientHeader = []): self
    {
        $this->checkDuplicatedHeaderParameters($this->sharedProtectedHeader, $recipientHeader);
        $this->checkDuplicatedHeaderParameters($this->sharedHeader, $recipientHeader);
        $clone = clone $this;
        $completeHeader = \array_merge($clone->sharedHeader, $recipientHeader, $clone->sharedProtectedHeader);
        $clone->checkAndSetContentEncryptionAlgorithm($completeHeader);
        $keyEncryptionAlgorithm = $clone->getKeyEncryptionAlgorithm($completeHeader);
        if (null === $clone->keyManagementMode) {
            $clone->keyManagementMode = $keyEncryptionAlgorithm->getKeyManagementMode();
        } else {
            if (!$clone->areKeyManagementModesCompatible($clone->keyManagementMode, $keyEncryptionAlgorithm->getKeyManagementMode())) {
                throw new \InvalidArgumentException('Foreign key management mode forbidden.');
            }
        }

        $compressionMethod = $clone->getCompressionMethod($completeHeader);
        if (null !== $compressionMethod) {
            if (null === $clone->compressionMethod) {
                $clone->compressionMethod = $compressionMethod;
            } elseif ($clone->compressionMethod->name() !== $compressionMethod->name()) {
                throw new \InvalidArgumentException('Incompatible compression method.');
            }
        }
        if (null === $compressionMethod && null !== $clone->compressionMethod) {
            throw new \InvalidArgumentException('Inconsistent compression method.');
        }
        $clone->checkKey($keyEncryptionAlgorithm, $recipientKey);
        $clone->recipients[] = [
            'key' => $recipientKey,
            'header' => $recipientHeader,
            'key_encryption_algorithm' => $keyEncryptionAlgorithm,
        ];

        return $clone;
    }
988478
public function createMessageFile($name = "defaultTranslationService", $selfedit="false", $language) {
	
		$this->addTranslationLanguageFromService(($selfedit == "true"), $name, $language);
		
		header('location:'.$_SERVER['HTTP_REFERER']);
	}
496441
public function putMessage($bundle, $key, $language, $message)
    {
        return $this->callService(
            self::SVC_PUT_MESSAGE,
            array(
                'bundle'     => $bundle,
                'key'        => $key,
                'language'   => $language,
                'message'    => $message,
            )
        );
    }
630497
public function subscribe($email, LanguageInterface $language = null)
    {
        if (!$this->validateEmail($email)) {
            throw new NewsletterCannotBeAddedException();
        }

        $newsletterSubscription = $this->getSubscription($email);

        if (!($newsletterSubscription instanceof NewsletterSubscriptionInterface)) {
            $newsletterSubscription = $this->newsletterSubscriptionFactory->create();
            $newsletterSubscription
                ->setEmail($email)
                ->setHash($this->hashGenerator->generate())
                ->setLanguage($language);
        }

        $newsletterSubscription->setEnabled(true);

        $this
            ->newsletterEventDispatcher
            ->dispatchSubscribeEvent($newsletterSubscription);

        return $this;
    }
72915
public function addRecipient($recipient)
    {
        if (is_string($recipient)) {
            $recipient = new Recipient($recipient);
        } elseif (!$recipient instanceof Recipient) {
            throw new \InvalidArgumentException('$recipient must be a string or an instance of Recipient.');
        }

        $this->recipients[] = $recipient;

        return $this;
    }
497221
public function Add($Recipient = '') {
      $this->Form->SetModel($this->ConversationModel);
      
      if ($this->Form->AuthenticatedPostBack()) {
         $RecipientUserIDs = array();
         $To = explode(',', $this->Form->GetFormValue('To', ''));
         $UserModel = new UserModel();
         foreach ($To as $Name) {
            if (trim($Name) != '') {
               $User = $UserModel->GetByUsername(trim($Name));
               if (is_object($User))
                  $RecipientUserIDs[] = $User->UserID;
            }
         }
         
         $this->EventArguments['Recipients'] = $RecipientUserIDs;
         $this->FireEvent('BeforeAddConversation');
         
         $this->Form->SetFormValue('RecipientUserID', $RecipientUserIDs);
         $ConversationID = $this->Form->Save($this->ConversationMessageModel);
         if ($ConversationID !== FALSE) {
            $Target = $this->Form->GetFormValue('Target', 'messages/'.$ConversationID);
            
            $this->RedirectUrl = Url($Target);
         }
      } else {
         if ($Recipient != '')
            $this->Form->SetValue('To', $Recipient);
      }
      if ($Target = Gdn::Request()->Get('Target'))
            $this->Form->AddHidden('Target', $Target);

      Gdn_Theme::Section('PostConversation');
      $this->Title(T('New Conversation'));
      $this->SetData('Breadcrumbs', array(array('Name' => T('Inbox'), 'Url' => '/messages/inbox'), array('Name' => $this->Data('Title'), 'Url' => 'messages/add')));
      $this->Render();      
   }
774091
public function polyglot_entities( $text, $language = null )
	{
		$data = $this->post_call('/polyglot/entities', ['text' => $text, 'lang' => $language] );
		$this->msg( $data );
		return new \Web64\Nlp\Classes\PolyglotResponse( $data['polyglot'] );
	}
823129
public function setEmailAddress($email_user, $lang = 'en')
    {
        $action = "set_email_user";
        $options = array(
            'email_user' => $email_user,
            'lang' => $lang,
            'sid_token' => $this->sid_token
        );

        return $this->client->post($action, $options);
    }
457175
private function _createWebhook(array $response)
    {
        $model = new Webhook();
        $model->setId($response['id']);
        isset($response['url']) ? $model->setUrl($response['url']) : $model->setEmail($response['email']);
        $model->setLivemode($response['livemode']);
        $model->setEventTypes($response['event_types']);
        $model->setCreatedAt($response['created_at']);
        $model->setUpdatedAt($response['updated_at']);
        $model->setAppId($response['app_id']);
        $model->setActive($response['active']);
        return $model;
    }
1129931
public function addKeyRecipient($recipientId, $publicKey)
    {
        try {
            $this->cipher->addKeyRecipient($recipientId, $publicKey);

            return $this;
        } catch (Exception $e) {
            throw new CipherException($e->getMessage(), $e->getCode());
        }
    }
794087
public function sendMessage($recipient, $message, $notificationType = NotificationType::REGULAR, $messagingType = MessagingType::RESPONSE)
    {
        $message = $this->createMessage($message);
        $options = RequestOptionsFactory::createForMessage($recipient, $message, $notificationType, $messagingType);
        $response = $this->client->send('POST', '/me/messages', null, [], [], $options);
        $responseData = $this->decodeResponse($response);

        return new MessageResponse($responseData['recipient_id'], $responseData['message_id']);
    }
722739
private function logCreate(\Swift_Mime_SimpleMessage $message, $status, $templateID, $language)
    {
        // Check Message
        if (null === $message->getId() || empty($message->getId())) {
            return false;
        }

        // Create Log
        $class = $this->bag->get('pd_mailer.mail_log_class');
        $this->log = new $class;
        $this->log->setMailId($message->getId());
        $this->log->setFrom($message->getFrom());
        $this->log->setTo($message->getTo());
        $this->log->setSubject($message->getSubject());
        $this->log->setBody($message->getBody());
        $this->log->setContentType($message->getContentType());
        $this->log->setDate($message->getDate());
        $this->log->setHeader($message->getHeaders()->toString());
        $this->log->setReplyTo($message->getReplyTo());
        $this->log->setStatus($status);
        $this->log->setTemplateId($templateID);
        $this->log->setLanguage($language);

        // Save
        $this->entityManager->persist($this->log);
        $this->entityManager->flush();

        return true;
    }
196249
static function createMessage( $context, $source, $comment = null, $translation = null )
    {
        $msg = array( "context" => $context,
                      "source" => $source,
                      "comment" => $comment,
                      "translation" => $translation );
        return $msg;
    }
24829
public function createSms($body, array $recipients, $sender)
    {
        $sms = $this->createEmptySms();
        $sms->setBody($body);
        $sms->setRecipients($recipients);
        $sms->setSender($sender);

        return $sms;
    }
841191
public function createWebhook($roomId, Webhook $webhook)
    {
        $response = $this->client->post(sprintf('/v2/room/%s/webhook', $roomId), $webhook->toJson());

        return $response['id'];
    }
896795
protected function createCheckTextsContext(
        array $texts,
        Language $languageFrom
    ): RequestContext {
        $requestContext = (new RequestContext(sprintf("%s/%s", $this->apiEndpoint, self::CHECK_TEXTS_API_PATH)))
            ->setRequestParameters(
                [
                    'lang' => $languageFrom->getCode()
                ]
            )
            ->setData(['text' => $texts])
            ->setMethod(RequestContext::METHOD_POST)
            ->setEncodeArraysUsingDuplication(true)
            ->setContentType(RequestContext::CONTENT_TYPE_FORM_URLENCODED)
            ->setResponseContextClass(JsonResponseContext::class);

        return $requestContext;
    }