public function assign($media, $duration, $playlistId)
    {
        $this->playlistId = $playlistId;
        $this->media = $media;
        $this->getLogger()->info('Assigning Media To Playlist ' . $this->playlistId);
        $response = $this->doPost('/playlist/library/assign/' . $playlistId, [
        	'media' => $media,
            'duration' => $duration
        	]);

        // Parse response
        //  set properties
        $this->playlistId = $response['playlistId'];

        $this->getLogger()->debug('Creating child object Widgets and linking it to parent Playlist');
        // Set widgets property (with XiboWidget objects)
        foreach ($response['widgets'] as $widget) {
            $this->widgets[] = (new XiboWidget($this->getEntityProvider()))->hydrate($widget);
        }

        return $this;
    }