will be depricated

@param string $mediaContentKey
@param string|null $clientUserId
@param array $optParams
@return string
@throws ClientException
161245
public function getMediaToken($mediaContentKey, $clientUserId = null, array $optParams = [])
    {
        if (!isset($optParams['security_key'])) {
            $optParams['security_key'] = $this->serviceAccount->getKey();
        }

        if (!isset($optParams['media_content_key'])) {
            $optParams['media_content_key'] = $mediaContentKey;
        }

        if (!empty($clientUserId)) {
            $optParams['client_user_id'] = $clientUserId;
        }

        if (!isset($optParams['expire_time'])) {
            $optParams['expire_time'] = 7200;
        }

        $response = $this->getResponseJSON(
            'POST',
            'media_auth/media_token/get_media_link_by_userid.json',
            [],
            $optParams
        );

        if (!isset($response->result->media_token)) {
            throw new ClientException('Response is invalid.');
        }

        return $response->result->media_token;
    }
1299835
public function message($to, $message, $mediaUrls = null, array $params = [])
    {
        $params['body'] = $message;

        if (!isset($params['from'])) {
            $params['from'] = $this->from;
        }

        if (!empty($mediaUrls)) {
            $params['mediaUrl'] = $mediaUrls;
        }

        return $this->getTwilio()->messages->create($to, $params);
    }
372667
public function undelete($userKey, Google_UserUndelete $postBody, $optParams = array()) {
      $params = array('userKey' => $userKey, 'postBody' => $postBody);
      $params = array_merge($params, $optParams);
      $data = $this->__call('undelete', array($params));
      return $data;
    }
181687
public function listVideoFormats($profileId, $optParams = array())
  {
    $params = array('profileId' => $profileId);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_Dfareporting_VideoFormatsListResponse");
  }
126632
protected function removeMediaFromEntity($entityName, $id, $mediaId)
    {
        try {
            $delete = function() use ($entityName, $id, $mediaId) {
                $em = $this->getDoctrine()->getManager();
                $entity = $em->getRepository($entityName)->find($id);
                $media = $this->container->get('sulu.repository.media')->find($mediaId);

                if (!$entity) {
                    throw new EntityNotFoundException($entityName, $id);
                }

                $mediaEntityName = $this->getParameter('sulu.model.media.class');

                if (!$media) {
                    throw new EntityNotFoundException($mediaEntityName, $mediaId);
                }

                if (!$entity->getMedias()->contains($media)) {
                    throw new RestException(
                        'Relation between ' . $entityName .
                        ' and ' . $mediaEntityName . ' with id ' . $mediaId . ' does not exists!'
                    );
                }

                $entity->removeMedia($media);
                $em->flush();
            };

            $view = $this->responseDelete($id, $delete);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (RestException $exc) {
            $view = $this->view($exc->toArray(), 400);
        } catch (\Exception $e) {
            $view = $this->view($e->getMessage(), 400);
        }

        return $this->handleView($view);
    }
1124523
public function delete($customerId, $schemaKey, $optParams = array())
  {
    $params = array('customerId' => $customerId, 'schemaKey' => $schemaKey);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params));
  }
945454
public function touch($fileId, $optParams = array())
  {
    $params = array('fileId' => $fileId);
    $params = array_merge($params, $optParams);
    return $this->call('touch', array($params), "Drive_DriveFile");
  }
102819
public function linkContentKeyToAsset($asset, $contentKey)
    {
        $assetId = Utilities::getEntityId(
            $asset,
            'WindowsAzure\MediaServices\Models\Asset'
        );
        $assetId = urlencode($assetId);

        $contentKeyId = Utilities::getEntityId(
            $contentKey,
            'WindowsAzure\MediaServices\Models\ContentKey'
        );

        $contentKeyId = urlencode($contentKeyId);

        $contentWriter = new \XMLWriter();
        $contentWriter->openMemory();
        $contentWriter->writeElementNS(
            'data',
            'uri',
            Resources::DS_XML_NAMESPACE,
            $this->getUri()."ContentKeys('{$contentKeyId}')"
        );

        $method = Resources::HTTP_POST;
        $path = "Assets('{$assetId}')/\$links/ContentKeys";
        $headers = [
            Resources::CONTENT_TYPE => Resources::XML_CONTENT_TYPE,
        ];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_NO_CONTENT;
        $body = $contentWriter->outputMemory();

        $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode,
            $body
        );
    }
806854
private function populateRequest($clientKey)
  {
    $request = new Request();
    $request->clientKey = $clientKey;
    $request->area = $this->area;
    $request->collection = $this->collection;
    $request->userId = $this->userId;
    $request->query = $this->query;
    $request->fields = $this->fields;
    $request->orFields = $this->orFields;
    $request->language = $this->language;
    $request->biasingProfile = $this->biasingProfile;
    $request->pageSize = $this->pageSize;
    $request->skip = $this->skip;
    $request->customUrlParams = $this->customUrlParams;
    $request->refinements = $this->generateSelectedRefinements($this->navigations);
    $request->restrictNavigation = $this->restrictNavigation;

    if (!empty($this->biasing)) {
      $request->biasing = self::convertBiasing($this->biasing);
    }

    if (!empty($this->includedNavigations)) {
      $request->includedNavigations = $this->includedNavigations;
    }

    if (!empty($this->excludedNavigations)) {
      $request->excludedNavigations = $this->excludedNavigations;
    }

    $pruneRefinements = $this->pruneRefinements;
    if (isset($pruneRefinements) && $pruneRefinements === false) {
      $request->pruneRefinements = false;
    }

    $disableAutocorrection = $this->disableAutocorrection;
    if (isset($disableAutocorrection) && $disableAutocorrection === true) {
      $request->disableAutocorrection = true;
    }

    $wildcardSearchEnabled = $this->wildcardSearchEnabled;
    if (isset($wildcardSearchEnabled) && $wildcardSearchEnabled === true) {
      $request->wildcardSearchEnabled = true;
    }

    if (!empty($this->sort)) {
      foreach ($this->sort as $s) {
        array_push($request->sort, $this->convertSort($s));
      }
    }

//        $returnBinary = $this->returnBinary;
//        if (isset($returnBinary) && $returnBinary === true) {
//            $request->returnBinary = true;
//        }

    return $request;
  }
221304
public function stop($userId, $optParams = array())
  {
    $params = array('userId' => $userId);
    $params = array_merge($params, $optParams);
    return $this->call('stop', array($params));
  }
1364028
public function getClientKey($client_id, $subject)
    {
        $stmt = $this->db->prepare($sql = sprintf('SELECT public_key from %s where client_id=:client_id AND subject=:subject', $this->config['jwt_table']));

        $stmt->execute(array('client_id' => $client_id, 'subject' => $subject));
        return $stmt->fetch();
    }
34564
public function invalidate($userKey, $optParams = array())
  {
    $params = array('userKey' => $userKey);
    $params = array_merge($params, $optParams);
    return $this->call('invalidate', array($params));
  }
560148
public function delegateAction($templateKey, $mediaTypeName)
    {
        $mediaTypeManager = $this->get('phlexible_media_type.media_type_manager');
        $templateManager = $this->get('phlexible_media_template.template_manager');
        $delegateService = $this->get('phlexible_media_cache.image_delegate.service');

        $template = $templateManager->find($templateKey);

        $mediaType = $mediaTypeManager->find(strtolower($mediaTypeName));
        $filePath = $delegateService->getClean($template, $mediaType);
        $fileSize = filesize($filePath);
        $mimeType = 'image/gif';

        $response = new BinaryFileResponse($filePath, 200, array('Content-Type' => $mimeType));

        return $response;
    }
664210
public function previewMpnews($media_id = '', $userid = '', $type = 'openid')
    {
        $queryStr = [];

        if ($type == 'towxname') {
            $queryStr['towxname'] = $userid;
        } else {
            $queryStr['touser'] = $userid;
        }

        $queryStr['mpnews']['media_id'] = $media_id;
        $queryStr['msgtype']            = 'mpnews';

        $this->module = 'message';

        $res = $this->_post('mass/preview', $queryStr);

        return $res;
    }
1119777
public function delete($customerId, $resourceId, $optParams = array()) {
      $params = array('customerId' => $customerId, 'resourceId' => $resourceId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('delete', array($params));
      return $data;
    }
1262167
public function delete($customerId, $orgUnitPath, $optParams = array())
  {
    $params = array('customerId' => $customerId, 'orgUnitPath' => $orgUnitPath);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params));
  }
1076864
public function update($userKey, Directory_User $postBody, $optParams = array())
  {
    $params = array('userKey' => $userKey, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('update', array($params), "Directory_User");
  }