Operation putMediaCacheConfig3

Updates the server MediaCache configuration.

@param string $serverName Reserved for future use (required)
@param MediaCacheConfig3 $body  (required)

@return void
@throws ApiException on non-2xx response
337077
public function putMediaCacheConfig3($serverName, $body)
    {
        list($response) = $this->putMediaCacheConfig3WithHttpInfo($serverName, $body);
        return $response;
    }
41617
protected function setBody($body, $contentType)
    {
        $message = $this->getSwiftMessage();
        $oldBody = $message->getBody();
        $charset = $message->getCharset();
        if (empty($oldBody)) {
            $parts = $message->getChildren();
            $partFound = false;
            foreach ($parts as $key => $part) {
                if (!($part instanceof \Swift_Mime_Attachment)) {
                    /* @var $part \Swift_Mime_MimePart */
                    if ($part->getContentType() == $contentType) {
                        $charset = $part->getCharset();
                        unset($parts[$key]);
                        $partFound = true;
                        break;
                    }
                }
            }
            if ($partFound) {
                reset($parts);
                $message->setChildren($parts);
                $message->addPart($body, $contentType, $charset);
            } else {
                $message->setBody($body, $contentType);
            }
        } else {
            $oldContentType = $message->getContentType();
            if ($oldContentType == $contentType) {
                $message->setBody($body, $contentType);
            } else {
                $message->setBody(null);
                $message->setContentType(null);
                $message->addPart($oldBody, $oldContentType, $charset);
                $message->addPart($body, $contentType, $charset);
            }
        }
    }
380195
public function put(string $body, string $version = HttpVersion::HTTP_1_1): HttpResponse
    {
        return HttpRequest::create($this->httpUri, $this->headers)
                ->put($body, $this->timeout, $version);
    }
1314182
protected function addMediaToEntity($entityName, $id, $mediaId)
    {
        try {
            $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);
            }

            if (!$media) {
                throw new EntityNotFoundException($this->getParameter('sulu.model.media.class'), $mediaId);
            }

            if ($entity->getMedias()->contains($media)) {
                throw new RestException('Relation already exists');
            }

            $entity->addMedia($media);
            $em->flush();

            $view = $this->view(
                new Media(
                    $media,
                    $this->getUser()->getLocale(),
                    null
                ),
                200
            );
        } 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);
    }
962214
protected void handleUpdateCache(BoxResponse<T> response) throws BoxException {
        BoxCache cache = BoxConfig.getCache();
        if (cache != null) {
            cache.put(response);
        }
    }
1369854
protected function applyBody(&$contextParams, $methodName, $body, $json = true)
    {
        // request body
        if ($methodName == 'POST' || $methodName == 'PUT') {

            $body = (array)$body;

            if($json){
                $content = @json_encode($body);
                if(!$content){
                    throw new \Exception('Body is not serializable');
                }
            }else{
                $content = http_build_query($body);
            }

            $contextParams['http']['content'] = $content;

            $logger = $this->getLogger();
            $logger->debug('Document body: '.var_export($body, true));
            $logger->debug('Document body (JSON-ified): '.$content);
        }
    }
37875
private void addBodyToContext(final String body) {
        if(!body.isEmpty()) {
            final JSONParser parser = new JSONParser();
            try {
                final JSONObject json = (JSONObject) parser.parse(body);
                context.put("requestBody", json);
            } catch (final ParseException e) {
                e.printStackTrace();
            }
        }
    }
1118465
public function putMediaCacheStoreConfig($serverName, $body)
    {
        list($response) = $this->putMediaCacheStoreConfigWithHttpInfo($serverName, $body);
        return $response;
    }
1027153
public function putMediaCacheConfigAdv($serverName, $body)
    {
        list($response) = $this->putMediaCacheConfigAdvWithHttpInfo($serverName, $body);
        return $response;
    }
228220
public function postPublishersConfig($serverName, $body)
    {
        list($response) = $this->postPublishersConfigWithHttpInfo($serverName, $body);
        return $response;
    }
55728
public function postPublishersConfig3($serverName, $body)
    {
        list($response) = $this->postPublishersConfig3WithHttpInfo($serverName, $body);
        return $response;
    }
843533
public function update($xmlBody = false)
    {
        $this->request($this->dataciteUrl . 'metadata/', $xmlBody);
        return $this->hasError() ? false : true;
    }
112608
public function put($uri, $body = null, array $options = [])
    {
        return $this->request(self::REQUEST_METHOD_PUT, $uri, $body, $options);
    }
506458
public function postMediaCacheSourcesConfig3($serverName, $body)
    {
        list($response) = $this->postMediaCacheSourcesConfig3WithHttpInfo($serverName, $body);
        return $response;
    }
387672
public function setBody($body)
    {
        switch ($this->type) {
            case self::TYPE_INT:
                $error = !is_numeric($body);
                break;
            case self::TYPE_STRING:
            default:
                $error = !is_string($body);
                break;
        }
        if ($error) {
            throw new InvalidResponseException($this->command, $body);
        }
        parent::setBody($body);
    }
371160
public function putServerConfig($serverName, $body)
    {
        list($response) = $this->putServerConfigWithHttpInfo($serverName, $body);
        return $response;
    }
1123347
public void setCache(String cacheName, String cacheKey, Object object) {
        Cache cache = cacheManager.getCache(cacheName);
        if (cache == null) {
            return;
        }
        cache.put(new Element(cacheKey, object));
    }