GoogleGAL_Service_Gmail_UsersDrafts_Resource

The "drafts" collection of methods.

Defined (1)

The class is defined in the following location(s).

/core/Google/Service/Gmail.php  
  1. class GoogleGAL_Service_Gmail_UsersDrafts_Resource extends GoogleGAL_Service_Resource 
  2.  
  3. /** 
  4. * Creates a new draft with the DRAFT label. (drafts.create) 
  5. * @param string $userId The user's email address. The special value me can be 
  6. * used to indicate the authenticated user. 
  7. * @param GoogleGAL_Draft $postBody 
  8. * @param array $optParams Optional parameters. 
  9. * @return GoogleGAL_Service_Gmail_Draft 
  10. */ 
  11. public function create($userId, GoogleGAL_Service_Gmail_Draft $postBody, $optParams = array()) 
  12. $params = array('userId' => $userId, 'postBody' => $postBody); 
  13. $params = array_merge($params, $optParams); 
  14. return $this->call('create', array($params), "GoogleGAL_Service_Gmail_Draft"); 
  15.  
  16. /** 
  17. * Immediately and permanently deletes the specified draft. Does not simply 
  18. * trash it. (drafts.delete) 
  19. * @param string $userId The user's email address. The special value me can be 
  20. * used to indicate the authenticated user. 
  21. * @param string $id The ID of the draft to delete. 
  22. * @param array $optParams Optional parameters. 
  23. */ 
  24. public function delete($userId, $id, $optParams = array()) 
  25. $params = array('userId' => $userId, 'id' => $id); 
  26. $params = array_merge($params, $optParams); 
  27. return $this->call('delete', array($params)); 
  28.  
  29. /** 
  30. * Gets the specified draft. (drafts.get) 
  31. * @param string $userId The user's email address. The special value me can be 
  32. * used to indicate the authenticated user. 
  33. * @param string $id The ID of the draft to retrieve. 
  34. * @param array $optParams Optional parameters. 
  35. * @opt_param string format The format to return the draft in. 
  36. * @return GoogleGAL_Service_Gmail_Draft 
  37. */ 
  38. public function get($userId, $id, $optParams = array()) 
  39. $params = array('userId' => $userId, 'id' => $id); 
  40. $params = array_merge($params, $optParams); 
  41. return $this->call('get', array($params), "GoogleGAL_Service_Gmail_Draft"); 
  42.  
  43. /** 
  44. * Lists the drafts in the user's mailbox. (drafts.listUsersDrafts) 
  45. * @param string $userId The user's email address. The special value me can be 
  46. * used to indicate the authenticated user. 
  47. * @param array $optParams Optional parameters. 
  48. * @opt_param string pageToken Page token to retrieve a specific page of results 
  49. * in the list. 
  50. * @opt_param string maxResults Maximum number of drafts to return. 
  51. * @return GoogleGAL_Service_Gmail_ListDraftsResponse 
  52. */ 
  53. public function listUsersDrafts($userId, $optParams = array()) 
  54. $params = array('userId' => $userId); 
  55. $params = array_merge($params, $optParams); 
  56. return $this->call('list', array($params), "GoogleGAL_Service_Gmail_ListDraftsResponse"); 
  57.  
  58. /** 
  59. * Sends the specified, existing draft to the recipients in the To, Cc, and Bcc 
  60. * headers. (drafts.send) 
  61. * @param string $userId The user's email address. The special value me can be 
  62. * used to indicate the authenticated user. 
  63. * @param GoogleGAL_Draft $postBody 
  64. * @param array $optParams Optional parameters. 
  65. * @return GoogleGAL_Service_Gmail_Message 
  66. */ 
  67. public function send($userId, GoogleGAL_Service_Gmail_Draft $postBody, $optParams = array()) 
  68. $params = array('userId' => $userId, 'postBody' => $postBody); 
  69. $params = array_merge($params, $optParams); 
  70. return $this->call('send', array($params), "GoogleGAL_Service_Gmail_Message"); 
  71.  
  72. /** 
  73. * Replaces a draft's content. (drafts.update) 
  74. * @param string $userId The user's email address. The special value me can be 
  75. * used to indicate the authenticated user. 
  76. * @param string $id The ID of the draft to update. 
  77. * @param GoogleGAL_Draft $postBody 
  78. * @param array $optParams Optional parameters. 
  79. * @return GoogleGAL_Service_Gmail_Draft 
  80. */ 
  81. public function update($userId, $id, GoogleGAL_Service_Gmail_Draft $postBody, $optParams = array()) 
  82. $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); 
  83. $params = array_merge($params, $optParams); 
  84. return $this->call('update', array($params), "GoogleGAL_Service_Gmail_Draft");