Google_ObjectsServiceResource

The "objects" collection of methods.

Defined (1)

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

/src/contrib/Google_StorageService.php  
  1. class Google_ObjectsServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Concatenates a list of existing objects into a new object in the same bucket. (objects.compose) 
  5. * @param string $destinationBucket Name of the bucket in which to store the new object. 
  6. * @param string $destinationObject Name of the new object. 
  7. * @param Google_ComposeRequest $postBody 
  8. * @param array $optParams Optional parameters. 
  9. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. 
  10. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  11. * @return Google_StorageObject 
  12. */ 
  13. public function compose($destinationBucket, $destinationObject, Google_ComposeRequest $postBody, $optParams = array()) { 
  14. $params = array('destinationBucket' => $destinationBucket, 'destinationObject' => $destinationObject, 'postBody' => $postBody); 
  15. $params = array_merge($params, $optParams); 
  16. $data = $this->__call('compose', array($params)); 
  17. if ($this->useObjects()) { 
  18. return new Google_StorageObject($data); 
  19. } else { 
  20. return $data; 
  21. /** 
  22. * Copies an object to a destination in the same location. Optionally overrides metadata. 
  23. * (objects.copy) 
  24. * @param string $sourceBucket Name of the bucket in which to find the source object. 
  25. * @param string $sourceObject Name of the source object. 
  26. * @param string $destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. 
  27. * @param string $destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. 
  28. * @param Google_StorageObject $postBody 
  29. * @param array $optParams Optional parameters. 
  30. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. 
  31. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. 
  32. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. 
  33. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. 
  34. * @opt_param string ifSourceGenerationMatch Makes the operation conditional on whether the source object's generation matches the given value. 
  35. * @opt_param string ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's generation does not match the given value. 
  36. * @opt_param string ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. 
  37. * @opt_param string ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. 
  38. * @opt_param string projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. 
  39. * @opt_param string sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). 
  40. * @return Google_StorageObject 
  41. */ 
  42. public function copy($sourceBucket, $sourceObject, $destinationBucket, $destinationObject, Google_StorageObject $postBody, $optParams = array()) { 
  43. $params = array('sourceBucket' => $sourceBucket, 'sourceObject' => $sourceObject, 'destinationBucket' => $destinationBucket, 'destinationObject' => $destinationObject, 'postBody' => $postBody); 
  44. $params = array_merge($params, $optParams); 
  45. $data = $this->__call('copy', array($params)); 
  46. if ($this->useObjects()) { 
  47. return new Google_StorageObject($data); 
  48. } else { 
  49. return $data; 
  50. /** 
  51. * Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled 
  52. * for the bucket, or if the generation parameter is used. (objects.delete) 
  53. * @param string $bucket Name of the bucket in which the object resides. 
  54. * @param string $object Name of the object. 
  55. * @param array $optParams Optional parameters. 
  56. * @opt_param string generation If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). 
  57. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. 
  58. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. 
  59. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  60. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. 
  61. */ 
  62. public function delete($bucket, $object, $optParams = array()) { 
  63. $params = array('bucket' => $bucket, 'object' => $object); 
  64. $params = array_merge($params, $optParams); 
  65. $data = $this->__call('delete', array($params)); 
  66. return $data; 
  67. /** 
  68. * Retrieves objects or their associated metadata. (objects.get) 
  69. * @param string $bucket Name of the bucket in which the object resides. 
  70. * @param string $object Name of the object. 
  71. * @param array $optParams Optional parameters. 
  72. * @opt_param string generation If present, selects a specific revision of this object (as opposed to the latest version, the default). 
  73. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's generation matches the given value. 
  74. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the object's generation does not match the given value. 
  75. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  76. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. 
  77. * @opt_param string projection Set of properties to return. Defaults to noAcl. 
  78. * @return Google_StorageObject 
  79. */ 
  80. public function get($bucket, $object, $optParams = array()) { 
  81. $params = array('bucket' => $bucket, 'object' => $object); 
  82. $params = array_merge($params, $optParams); 
  83. $data = $this->__call('get', array($params)); 
  84. if ($this->useObjects()) { 
  85. return new Google_StorageObject($data); 
  86. } else { 
  87. return $data; 
  88. /** 
  89. * Stores new data blobs and associated metadata. (objects.insert) 
  90. * @param string $bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. 
  91. * @param Google_StorageObject $postBody 
  92. * @param array $optParams Optional parameters. 
  93. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. 
  94. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. 
  95. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  96. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. 
  97. * @opt_param string name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. 
  98. * @opt_param string projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. 
  99. * @return Google_StorageObject 
  100. */ 
  101. public function insert($bucket, Google_StorageObject $postBody, $optParams = array()) { 
  102. $params = array('bucket' => $bucket, 'postBody' => $postBody); 
  103. $params = array_merge($params, $optParams); 
  104. $data = $this->__call('insert', array($params)); 
  105. if ($this->useObjects()) { 
  106. return new Google_StorageObject($data); 
  107. } else { 
  108. return $data; 
  109. /** 
  110. * Retrieves a list of objects matching the criteria. (objects.list) 
  111. * @param string $bucket Name of the bucket in which to look for objects. 
  112. * @param array $optParams Optional parameters. 
  113. * @opt_param string delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. 
  114. * @opt_param string maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. 
  115. * @opt_param string pageToken A previously-returned page token representing part of the larger set of results to view. 
  116. * @opt_param string prefix Filter results to objects whose names begin with this prefix. 
  117. * @opt_param string projection Set of properties to return. Defaults to noAcl. 
  118. * @opt_param bool versions If true, lists all versions of a file as distinct results. 
  119. * @return Google_Objects 
  120. */ 
  121. public function listObjects($bucket, $optParams = array()) { 
  122. $params = array('bucket' => $bucket); 
  123. $params = array_merge($params, $optParams); 
  124. $data = $this->__call('list', array($params)); 
  125. if ($this->useObjects()) { 
  126. return new Google_Objects($data); 
  127. } else { 
  128. return $data; 
  129. /** 
  130. * Updates a data blob's associated metadata. This method supports patch semantics. (objects.patch) 
  131. * @param string $bucket Name of the bucket in which the object resides. 
  132. * @param string $object Name of the object. 
  133. * @param Google_StorageObject $postBody 
  134. * @param array $optParams Optional parameters. 
  135. * @opt_param string generation If present, selects a specific revision of this object (as opposed to the latest version, the default). 
  136. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. 
  137. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. 
  138. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  139. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. 
  140. * @opt_param string projection Set of properties to return. Defaults to full. 
  141. * @return Google_StorageObject 
  142. */ 
  143. public function patch($bucket, $object, Google_StorageObject $postBody, $optParams = array()) { 
  144. $params = array('bucket' => $bucket, 'object' => $object, 'postBody' => $postBody); 
  145. $params = array_merge($params, $optParams); 
  146. $data = $this->__call('patch', array($params)); 
  147. if ($this->useObjects()) { 
  148. return new Google_StorageObject($data); 
  149. } else { 
  150. return $data; 
  151. /** 
  152. * Updates a data blob's associated metadata. (objects.update) 
  153. * @param string $bucket Name of the bucket in which the object resides. 
  154. * @param string $object Name of the object. 
  155. * @param Google_StorageObject $postBody 
  156. * @param array $optParams Optional parameters. 
  157. * @opt_param string generation If present, selects a specific revision of this object (as opposed to the latest version, the default). 
  158. * @opt_param string ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. 
  159. * @opt_param string ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. 
  160. * @opt_param string ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. 
  161. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. 
  162. * @opt_param string projection Set of properties to return. Defaults to full. 
  163. * @return Google_StorageObject 
  164. */ 
  165. public function update($bucket, $object, Google_StorageObject $postBody, $optParams = array()) { 
  166. $params = array('bucket' => $bucket, 'object' => $object, 'postBody' => $postBody); 
  167. $params = array_merge($params, $optParams); 
  168. $data = $this->__call('update', array($params)); 
  169. if ($this->useObjects()) { 
  170. return new Google_StorageObject($data); 
  171. } else { 
  172. return $data; 
  173. /** 
  174. * Watch for changes on all objects in a bucket. (objects.watchAll) 
  175. * @param string $bucket Name of the bucket in which to look for objects. 
  176. * @param Google_Channel $postBody 
  177. * @param array $optParams Optional parameters. 
  178. * @opt_param string delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. 
  179. * @opt_param string maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. 
  180. * @opt_param string pageToken A previously-returned page token representing part of the larger set of results to view. 
  181. * @opt_param string prefix Filter results to objects whose names begin with this prefix. 
  182. * @opt_param string projection Set of properties to return. Defaults to noAcl. 
  183. * @opt_param bool versions If true, lists all versions of a file as distinct results. 
  184. * @return Google_Channel 
  185. */ 
  186. public function watchAll($bucket, Google_Channel $postBody, $optParams = array()) { 
  187. $params = array('bucket' => $bucket, 'postBody' => $postBody); 
  188. $params = array_merge($params, $optParams); 
  189. $data = $this->__call('watchAll', array($params)); 
  190. if ($this->useObjects()) { 
  191. return new Google_Channel($data); 
  192. } else { 
  193. return $data;