Google_PermissionsServiceResource

The "permissions" collection of methods.

Defined (1)

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

/gdwpm-api/contrib/Google_DriveService.php  
  1. class Google_PermissionsServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Deletes a permission from a file. (permissions.delete) 
  5. * @param string $fileId The ID for the file. 
  6. * @param string $permissionId The ID for the permission. 
  7. * @param array $optParams Optional parameters. 
  8. */ 
  9. public function delete($fileId, $permissionId, $optParams = array()) { 
  10. $params = array('fileId' => $fileId, 'permissionId' => $permissionId); 
  11. $params = array_merge($params, $optParams); 
  12. $data = $this->__call('delete', array($params)); 
  13. return $data; 
  14. /** 
  15. * Gets a permission by ID. (permissions.get) 
  16. * @param string $fileId The ID for the file. 
  17. * @param string $permissionId The ID for the permission. 
  18. * @param array $optParams Optional parameters. 
  19. * @return Google_Permission 
  20. */ 
  21. public function get($fileId, $permissionId, $optParams = array()) { 
  22. $params = array('fileId' => $fileId, 'permissionId' => $permissionId); 
  23. $params = array_merge($params, $optParams); 
  24. $data = $this->__call('get', array($params)); 
  25. if ($this->useObjects()) { 
  26. return new Google_Permission($data); 
  27. } else { 
  28. return $data; 
  29. /** 
  30. * Inserts a permission for a file. (permissions.insert) 
  31. * @param string $fileId The ID for the file. 
  32. * @param Google_Permission $postBody 
  33. * @param array $optParams Optional parameters. 
  34. * @opt_param string emailMessage A custom message to include in notification emails. 
  35. * @opt_param bool sendNotificationEmails Whether to send notification emails when sharing to users or groups. 
  36. * @return Google_Permission 
  37. */ 
  38. public function insert($fileId, Google_Permission $postBody, $optParams = array()) { 
  39. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  40. $params = array_merge($params, $optParams); 
  41. $data = $this->__call('insert', array($params)); 
  42. if ($this->useObjects()) { 
  43. return new Google_Permission($data); 
  44. } else { 
  45. return $data; 
  46. /** 
  47. * Lists a file's permissions. (permissions.list) 
  48. * @param string $fileId The ID for the file. 
  49. * @param array $optParams Optional parameters. 
  50. * @return Google_PermissionList 
  51. */ 
  52. public function listPermissions($fileId, $optParams = array()) { 
  53. $params = array('fileId' => $fileId); 
  54. $params = array_merge($params, $optParams); 
  55. $data = $this->__call('list', array($params)); 
  56. if ($this->useObjects()) { 
  57. return new Google_PermissionList($data); 
  58. } else { 
  59. return $data; 
  60. /** 
  61. * Updates a permission. This method supports patch semantics. (permissions.patch) 
  62. * @param string $fileId The ID for the file. 
  63. * @param string $permissionId The ID for the permission. 
  64. * @param Google_Permission $postBody 
  65. * @param array $optParams Optional parameters. 
  66. * @opt_param bool transferOwnership Whether changing a role to 'owner' should also downgrade the current owners to writers. 
  67. * @return Google_Permission 
  68. */ 
  69. public function patch($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) { 
  70. $params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody); 
  71. $params = array_merge($params, $optParams); 
  72. $data = $this->__call('patch', array($params)); 
  73. if ($this->useObjects()) { 
  74. return new Google_Permission($data); 
  75. } else { 
  76. return $data; 
  77. /** 
  78. * Updates a permission. (permissions.update) 
  79. * @param string $fileId The ID for the file. 
  80. * @param string $permissionId The ID for the permission. 
  81. * @param Google_Permission $postBody 
  82. * @param array $optParams Optional parameters. 
  83. * @opt_param bool transferOwnership Whether changing a role to 'owner' should also downgrade the current owners to writers. 
  84. * @return Google_Permission 
  85. */ 
  86. public function update($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) { 
  87. $params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody); 
  88. $params = array_merge($params, $optParams); 
  89. $data = $this->__call('update', array($params)); 
  90. if ($this->useObjects()) { 
  91. return new Google_Permission($data); 
  92. } else { 
  93. return $data;