Example #1
0
 /**
  * Submit this draft paste to the Pastebin API.
  * @param \Brush\Accounts\Developer $developer The developer account to use to send the request.
  * @return \Brush\Pastes\Paste The created paste.
  */
 public function paste(Developer $developer)
 {
     // throw on any errors
     $this->validate();
     // create the request
     $pastebin = new ApiRequest($developer, self::ENDPOINT);
     $pastebin->setOption('paste');
     $this->addTo($pastebin->getRequest(), $developer);
     // send and create a paste from this draft
     return Paste::fromPasted($pastebin->send(), $this);
 }