Google_JobsServiceResource

The "jobs" collection of methods.

Defined (1)

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

/google-api/src/contrib/Google_BigqueryService.php  
  1. class Google_JobsServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Starts a new asynchronous job. (jobs.insert) 
  6. * @param string $projectId Project ID of the project that will be billed for the job 
  7. * @param Google_Job $postBody 
  8. * @param array $optParams Optional parameters. 
  9. * @return Google_Job 
  10. */ 
  11. public function insert($projectId, Google_Job $postBody, $optParams = array()) { 
  12. $params = array('projectId' => $projectId, 'postBody' => $postBody); 
  13. $params = array_merge($params, $optParams); 
  14. $data = $this->__call('insert', array($params)); 
  15. if ($this->useObjects()) { 
  16. return new Google_Job($data); 
  17. } else { 
  18. return $data; 
  19. /** 
  20. * Runs a BigQuery SQL query synchronously and returns query results if the query completes within a 
  21. * specified timeout. (jobs.query) 
  22. * @param string $projectId Project ID of the project billed for the query 
  23. * @param Google_QueryRequest $postBody 
  24. * @param array $optParams Optional parameters. 
  25. * @return Google_QueryResponse 
  26. */ 
  27. public function query($projectId, Google_QueryRequest $postBody, $optParams = array()) { 
  28. $params = array('projectId' => $projectId, 'postBody' => $postBody); 
  29. $params = array_merge($params, $optParams); 
  30. $data = $this->__call('query', array($params)); 
  31. if ($this->useObjects()) { 
  32. return new Google_QueryResponse($data); 
  33. } else { 
  34. return $data; 
  35. /** 
  36. * Lists all the Jobs in the specified project that were started by the user. (jobs.list) 
  37. * @param string $projectId Project ID of the jobs to list 
  38. * @param array $optParams Optional parameters. 
  39. * @opt_param string projection Restrict information returned to a set of selected fields 
  40. * @opt_param string stateFilter Filter for job state 
  41. * @opt_param bool allUsers Whether to display jobs owned by all users in the project. Default false 
  42. * @opt_param string maxResults Maximum number of results to return 
  43. * @opt_param string pageToken Page token, returned by a previous call, to request the next page of results 
  44. * @return Google_JobList 
  45. */ 
  46. public function listJobs($projectId, $optParams = array()) { 
  47. $params = array('projectId' => $projectId); 
  48. $params = array_merge($params, $optParams); 
  49. $data = $this->__call('list', array($params)); 
  50. if ($this->useObjects()) { 
  51. return new Google_JobList($data); 
  52. } else { 
  53. return $data; 
  54. /** 
  55. * Retrieves the results of a query job. (jobs.getQueryResults) 
  56. * @param string $projectId Project ID of the query job 
  57. * @param string $jobId Job ID of the query job 
  58. * @param array $optParams Optional parameters. 
  59. * @opt_param string timeoutMs How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error 
  60. * @opt_param string startIndex Zero-based index of the starting row 
  61. * @opt_param string maxResults Maximum number of results to read 
  62. * @return Google_GetQueryResultsResponse 
  63. */ 
  64. public function getQueryResults($projectId, $jobId, $optParams = array()) { 
  65. $params = array('projectId' => $projectId, 'jobId' => $jobId); 
  66. $params = array_merge($params, $optParams); 
  67. $data = $this->__call('getQueryResults', array($params)); 
  68. if ($this->useObjects()) { 
  69. return new Google_GetQueryResultsResponse($data); 
  70. } else { 
  71. return $data; 
  72. /** 
  73. * Retrieves the specified job by ID. (jobs.get) 
  74. * @param string $projectId Project ID of the requested job 
  75. * @param string $jobId Job ID of the requested job 
  76. * @param array $optParams Optional parameters. 
  77. * @return Google_Job 
  78. */ 
  79. public function get($projectId, $jobId, $optParams = array()) { 
  80. $params = array('projectId' => $projectId, 'jobId' => $jobId); 
  81. $params = array_merge($params, $optParams); 
  82. $data = $this->__call('get', array($params)); 
  83. if ($this->useObjects()) { 
  84. return new Google_Job($data); 
  85. } else { 
  86. return $data;