Google_FilesServiceResource

The "files" collection of methods.

Defined (1)

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

/gdwpm-api/contrib/Google_DriveService.php  
  1. class Google_FilesServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Creates a copy of the specified file. (files.copy) 
  5. * @param string $fileId The ID of the file to copy. 
  6. * @param Google_DriveFile $postBody 
  7. * @param array $optParams Optional parameters. 
  8. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  9. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  10. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  11. * @opt_param bool pinned Whether to pin the head revision of the new copy. 
  12. * @opt_param string timedTextLanguage The language of the timed text. 
  13. * @opt_param string timedTextTrackName The timed text track name. 
  14. * @opt_param string visibility The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false. 
  15. * @return Google_DriveFile 
  16. */ 
  17. public function copy($fileId, Google_DriveFile $postBody, $optParams = array()) { 
  18. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  19. $params = array_merge($params, $optParams); 
  20. $data = $this->__call('copy', array($params)); 
  21. if ($this->useObjects()) { 
  22. return new Google_DriveFile($data); 
  23. } else { 
  24. return $data; 
  25. /** 
  26. * Permanently deletes a file by ID. Skips the trash. (files.delete) 
  27. * @param string $fileId The ID of the file to delete. 
  28. * @param array $optParams Optional parameters. 
  29. */ 
  30. public function delete($fileId, $optParams = array()) { 
  31. $params = array('fileId' => $fileId); 
  32. $params = array_merge($params, $optParams); 
  33. $data = $this->__call('delete', array($params)); 
  34. return $data; 
  35. /** 
  36. * Gets a file's metadata by ID. (files.get) 
  37. * @param string $fileId The ID for the file in question. 
  38. * @param array $optParams Optional parameters. 
  39. * @opt_param string projection This parameter is deprecated and has no function. 
  40. * @opt_param bool updateViewedDate Whether to update the view date after successfully retrieving the file. 
  41. * @return Google_DriveFile 
  42. */ 
  43. public function get($fileId, $optParams = array()) { 
  44. $params = array('fileId' => $fileId); 
  45. $params = array_merge($params, $optParams); 
  46. $data = $this->__call('get', array($params)); 
  47. if ($this->useObjects()) { 
  48. return new Google_DriveFile($data); 
  49. } else { 
  50. return $data; 
  51. /** 
  52. * Insert a new file. (files.insert) 
  53. * @param Google_DriveFile $postBody 
  54. * @param array $optParams Optional parameters. 
  55. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  56. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  57. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  58. * @opt_param bool pinned Whether to pin the head revision of the uploaded file. 
  59. * @opt_param string timedTextLanguage The language of the timed text. 
  60. * @opt_param string timedTextTrackName The timed text track name. 
  61. * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. 
  62. * @opt_param string visibility The visibility of the new file. This parameter is only relevant when convert=false. 
  63. * @return Google_DriveFile 
  64. */ 
  65. public function insert(Google_DriveFile $postBody, $optParams = array()) { 
  66. $params = array('postBody' => $postBody); 
  67. $params = array_merge($params, $optParams); 
  68. $data = $this->__call('insert', array($params)); 
  69. if ($this->useObjects()) { 
  70. return new Google_DriveFile($data); 
  71. } else { 
  72. return $data; 
  73. /** 
  74. * Lists the user's files. (files.list) 
  75. * @param array $optParams Optional parameters. 
  76. * @opt_param int maxResults Maximum number of files to return. 
  77. * @opt_param string pageToken Page token for files. 
  78. * @opt_param string projection This parameter is deprecated and has no function. 
  79. * @opt_param string q Query string for searching files. 
  80. * @return Google_FileList 
  81. */ 
  82. public function listFiles($optParams = array()) { 
  83. $params = array(); 
  84. $params = array_merge($params, $optParams); 
  85. $data = $this->__call('list', array($params)); 
  86. if ($this->useObjects()) { 
  87. return new Google_FileList($data); 
  88. } else { 
  89. return $data; 
  90. /** 
  91. * Updates file metadata and/or content. This method supports patch semantics. (files.patch) 
  92. * @param string $fileId The ID of the file to update. 
  93. * @param Google_DriveFile $postBody 
  94. * @param array $optParams Optional parameters. 
  95. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  96. * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota). 
  97. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  98. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  99. * @opt_param bool pinned Whether to pin the new revision. 
  100. * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. 
  101. * @opt_param string timedTextLanguage The language of the timed text. 
  102. * @opt_param string timedTextTrackName The timed text track name. 
  103. * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. 
  104. * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. 
  105. * @return Google_DriveFile 
  106. */ 
  107. public function patch($fileId, Google_DriveFile $postBody, $optParams = array()) { 
  108. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  109. $params = array_merge($params, $optParams); 
  110. $data = $this->__call('patch', array($params)); 
  111. if ($this->useObjects()) { 
  112. return new Google_DriveFile($data); 
  113. } else { 
  114. return $data; 
  115. /** 
  116. * Set the file's updated time to the current server time. (files.touch) 
  117. * @param string $fileId The ID of the file to update. 
  118. * @param array $optParams Optional parameters. 
  119. * @return Google_DriveFile 
  120. */ 
  121. public function touch($fileId, $optParams = array()) { 
  122. $params = array('fileId' => $fileId); 
  123. $params = array_merge($params, $optParams); 
  124. $data = $this->__call('touch', array($params)); 
  125. if ($this->useObjects()) { 
  126. return new Google_DriveFile($data); 
  127. } else { 
  128. return $data; 
  129. /** 
  130. * Moves a file to the trash. (files.trash) 
  131. * @param string $fileId The ID of the file to trash. 
  132. * @param array $optParams Optional parameters. 
  133. * @return Google_DriveFile 
  134. */ 
  135. public function trash($fileId, $optParams = array()) { 
  136. $params = array('fileId' => $fileId); 
  137. $params = array_merge($params, $optParams); 
  138. $data = $this->__call('trash', array($params)); 
  139. if ($this->useObjects()) { 
  140. return new Google_DriveFile($data); 
  141. } else { 
  142. return $data; 
  143. /** 
  144. * Restores a file from the trash. (files.untrash) 
  145. * @param string $fileId The ID of the file to untrash. 
  146. * @param array $optParams Optional parameters. 
  147. * @return Google_DriveFile 
  148. */ 
  149. public function untrash($fileId, $optParams = array()) { 
  150. $params = array('fileId' => $fileId); 
  151. $params = array_merge($params, $optParams); 
  152. $data = $this->__call('untrash', array($params)); 
  153. if ($this->useObjects()) { 
  154. return new Google_DriveFile($data); 
  155. } else { 
  156. return $data; 
  157. /** 
  158. * Updates file metadata and/or content. (files.update) 
  159. * @param string $fileId The ID of the file to update. 
  160. * @param Google_DriveFile $postBody 
  161. * @param array $optParams Optional parameters. 
  162. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  163. * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota). 
  164. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  165. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  166. * @opt_param bool pinned Whether to pin the new revision. 
  167. * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. 
  168. * @opt_param string timedTextLanguage The language of the timed text. 
  169. * @opt_param string timedTextTrackName The timed text track name. 
  170. * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. 
  171. * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. 
  172. * @return Google_DriveFile 
  173. */ 
  174. public function update($fileId, Google_DriveFile $postBody, $optParams = array()) { 
  175. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  176. $params = array_merge($params, $optParams); 
  177. $data = $this->__call('update', array($params)); 
  178. if ($this->useObjects()) { 
  179. return new Google_DriveFile($data); 
  180. } else { 
  181. return $data; 
  182. /** 
  183. * Subscribe to changes on a file (files.watch) 
  184. * @param string $fileId The ID for the file in question. 
  185. * @param Google_Channel $postBody 
  186. * @param array $optParams Optional parameters. 
  187. * @opt_param string projection This parameter is deprecated and has no function. 
  188. * @opt_param bool updateViewedDate Whether to update the view date after successfully retrieving the file. 
  189. * @return Google_Channel 
  190. */ 
  191. public function watch($fileId, Google_Channel $postBody, $optParams = array()) { 
  192. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  193. $params = array_merge($params, $optParams); 
  194. $data = $this->__call('watch', array($params)); 
  195. if ($this->useObjects()) { 
  196. return new Google_Channel($data); 
  197. } else { 
  198. return $data;