/**
  * @return object
  * @throws \Exception
  */
 public function execute()
 {
     $viewed_time = $this->secondsViewedFor * 1000;
     $json = json_encode(array($this->snapId => array("c" => $this->screenshot ? "1" : "0", "replayed" => $this->replayed ? "1" : "0", "sv" => $viewed_time, "t" => time())));
     $this->addParam("json", $json);
     return parent::execute();
 }
 /**
  * @param $snapchat Snapchat
  * @param $payload SendMediaPayload
  */
 public function __construct($snapchat, $payload)
 {
     parent::__construct($snapchat);
     $this->payload = $payload;
     $this->addParam("time", $payload->time);
     $this->addParam("media_id", $payload->media_id);
     $this->addParam("zipped", $payload->zipped);
     $this->addParam("camera_front_facing", "0");
     $this->addParam("orientation", self::ORIENTATION_PORTRAIT);
     $this->addParam("features_map", "{}");
     if (!empty($payload->recipients)) {
         $this->addParam("recipients", json_encode($payload->recipients));
     }
     if (!empty($payload->recipient_ids)) {
         $this->addParam("recipient_ids", json_encode($payload->recipient_ids));
     }
     if ($payload->set_as_story) {
         $this->addParam("shared_ids", "{}");
         $this->addParam("caption_text_display", "");
         $this->addParam("client_id", $payload->media_id);
         $this->addParam("my_story", "true");
         $this->addParam("type", $payload->type);
         $this->addParam("story_timestamp", RequestUtil::getCurrentMillis() / 1000);
         //todo: Support Video Thumbnails
         //$this->addFile("thumbnail_data", new RequestFile($this->payload->file_thumbnail, "application/octet-stream", "thumbnail_data"));
     }
 }
 /**
  * @return object
  * @throws \Exception
  */
 public function execute()
 {
     $friend_stories = array();
     $friend_stories[] = array("id" => $this->storyId, "screenshot_count" => $this->screenshot ? "1" : "0", "timestamp" => RequestUtil::getCurrentMillis());
     $this->addParam("friend_stories", json_encode($friend_stories));
     return parent::execute();
 }
 /**
  * @param $snapchat Snapchat
  * @param $conversationId string Conversation ID
  */
 public function __construct($snapchat, $conversationId)
 {
     parent::__construct($snapchat);
     $this->addParam("conversation_id", $conversationId);
 }
 /**
  * @return FriendResponse
  * @throws \Exception
  */
 public function execute()
 {
     return parent::execute();
 }
 /**
  * @return object
  * @throws \Exception
  */
 public function execute()
 {
     return StoryCrypto::decryptStory(parent::execute(), $this->mediaKey, $this->mediaIv);
 }
 /**
  * @param $snapchat Snapchat
  * @param $id string Snap ID to Download
  */
 public function __construct($snapchat, $id)
 {
     parent::__construct($snapchat);
     $this->addParam("id", $id);
 }
 /**
  * @return UploadMediaPayload
  * @throws \Exception
  */
 public function execute()
 {
     parent::execute();
     return $this->payload;
 }
 /**
  * @param $snapchat Snapchat
  * @param $storyId string Story Id
  */
 public function __construct($snapchat, $storyId)
 {
     parent::__construct($snapchat);
     $this->addParam("story_id", $storyId);
 }
 /**
  * @param $snapchat Snapchat
  */
 public function __construct($snapchat)
 {
     parent::__construct($snapchat);
     $this->addParam("events", "[]");
 }
 /**
  * @param $snapchat Snapchat
  * @param $messages ChatMessage[] Chat Messages to Send
  */
 public function __construct($snapchat, $messages)
 {
     parent::__construct($snapchat);
     //todo: this doesn't work. (Due to Private Variables)
     $this->addParam("messages", json_encode($messages));
 }