Google_FilesServiceResource

The "files" collection of methods.

Defined (2)

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

/google-api/src/contrib/Google_DfareportingService.php  
  1. class Google_FilesServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Lists files for a user profile. (files.list) 
  6. * @param string $profileId The DFA profile ID. 
  7. * @param array $optParams Optional parameters. 
  8. * @opt_param int maxResults Maximum number of results to return. 
  9. * @opt_param string pageToken The value of the nextToken from the previous result page. 
  10. * @opt_param string sortField The field by which to sort the list. 
  11. * @opt_param string sortOrder Order of sorted results, default is 'DESCENDING'. 
  12. * @return Google_FileList 
  13. */ 
  14. public function listFiles($profileId, $optParams = array()) { 
  15. $params = array('profileId' => $profileId); 
  16. $params = array_merge($params, $optParams); 
  17. $data = $this->__call('list', array($params)); 
  18. if ($this->useObjects()) { 
  19. return new Google_FileList($data); 
  20. } else { 
  21. return $data; 
/google-api/src/contrib/Google_DriveService.php  
  1. class Google_FilesServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Creates a copy of the specified file. (files.copy) 
  6. * @param string $fileId The ID of the file to copy. 
  7. * @param Google_DriveFile $postBody 
  8. * @param array $optParams Optional parameters. 
  9. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  10. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  11. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  12. * @opt_param bool pinned Whether to pin the head revision of the new copy. 
  13. * @opt_param string timedTextLanguage The language of the timed text. 
  14. * @opt_param string timedTextTrackName The timed text track name. 
  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. * @return Google_DriveFile 
  63. */ 
  64. public function insert(Google_DriveFile $postBody, $optParams = array()) { 
  65. $params = array('postBody' => $postBody); 
  66. $params = array_merge($params, $optParams); 
  67. $data = $this->__call('insert', array($params)); 
  68. if ($this->useObjects()) { 
  69. return new Google_DriveFile($data); 
  70. } else { 
  71. return $data; 
  72. /** 
  73. * Lists the user's files. (files.list) 
  74. * @param array $optParams Optional parameters. 
  75. * @opt_param int maxResults Maximum number of files to return. 
  76. * @opt_param string pageToken Page token for files. 
  77. * @opt_param string projection This parameter is deprecated and has no function. 
  78. * @opt_param string q Query string for searching files. 
  79. * @return Google_FileList 
  80. */ 
  81. public function listFiles($optParams = array()) { 
  82. $params = array(); 
  83. $params = array_merge($params, $optParams); 
  84. $data = $this->__call('list', array($params)); 
  85. if ($this->useObjects()) { 
  86. return new Google_FileList($data); 
  87. } else { 
  88. return $data; 
  89. /** 
  90. * Updates file metadata and/or content. This method supports patch semantics. (files.patch) 
  91. * @param string $fileId The ID of the file to update. 
  92. * @param Google_DriveFile $postBody 
  93. * @param array $optParams Optional parameters. 
  94. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  95. * @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). 
  96. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  97. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  98. * @opt_param bool pinned Whether to pin the new revision. 
  99. * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. 
  100. * @opt_param string timedTextLanguage The language of the timed text. 
  101. * @opt_param string timedTextTrackName The timed text track name. 
  102. * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. 
  103. * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. 
  104. * @return Google_DriveFile 
  105. */ 
  106. public function patch($fileId, Google_DriveFile $postBody, $optParams = array()) { 
  107. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  108. $params = array_merge($params, $optParams); 
  109. $data = $this->__call('patch', array($params)); 
  110. if ($this->useObjects()) { 
  111. return new Google_DriveFile($data); 
  112. } else { 
  113. return $data; 
  114. /** 
  115. * Set the file's updated time to the current server time. (files.touch) 
  116. * @param string $fileId The ID of the file to update. 
  117. * @param array $optParams Optional parameters. 
  118. * @return Google_DriveFile 
  119. */ 
  120. public function touch($fileId, $optParams = array()) { 
  121. $params = array('fileId' => $fileId); 
  122. $params = array_merge($params, $optParams); 
  123. $data = $this->__call('touch', array($params)); 
  124. if ($this->useObjects()) { 
  125. return new Google_DriveFile($data); 
  126. } else { 
  127. return $data; 
  128. /** 
  129. * Moves a file to the trash. (files.trash) 
  130. * @param string $fileId The ID of the file to trash. 
  131. * @param array $optParams Optional parameters. 
  132. * @return Google_DriveFile 
  133. */ 
  134. public function trash($fileId, $optParams = array()) { 
  135. $params = array('fileId' => $fileId); 
  136. $params = array_merge($params, $optParams); 
  137. $data = $this->__call('trash', array($params)); 
  138. if ($this->useObjects()) { 
  139. return new Google_DriveFile($data); 
  140. } else { 
  141. return $data; 
  142. /** 
  143. * Restores a file from the trash. (files.untrash) 
  144. * @param string $fileId The ID of the file to untrash. 
  145. * @param array $optParams Optional parameters. 
  146. * @return Google_DriveFile 
  147. */ 
  148. public function untrash($fileId, $optParams = array()) { 
  149. $params = array('fileId' => $fileId); 
  150. $params = array_merge($params, $optParams); 
  151. $data = $this->__call('untrash', array($params)); 
  152. if ($this->useObjects()) { 
  153. return new Google_DriveFile($data); 
  154. } else { 
  155. return $data; 
  156. /** 
  157. * Updates file metadata and/or content. (files.update) 
  158. * @param string $fileId The ID of the file to update. 
  159. * @param Google_DriveFile $postBody 
  160. * @param array $optParams Optional parameters. 
  161. * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format. 
  162. * @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). 
  163. * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 
  164. * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes. 
  165. * @opt_param bool pinned Whether to pin the new revision. 
  166. * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. 
  167. * @opt_param string timedTextLanguage The language of the timed text. 
  168. * @opt_param string timedTextTrackName The timed text track name. 
  169. * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. 
  170. * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. 
  171. * @return Google_DriveFile 
  172. */ 
  173. public function update($fileId, Google_DriveFile $postBody, $optParams = array()) { 
  174. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  175. $params = array_merge($params, $optParams); 
  176. $data = $this->__call('update', array($params)); 
  177. if ($this->useObjects()) { 
  178. return new Google_DriveFile($data); 
  179. } else { 
  180. return $data;