PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/google/apiclient-services/src/Dataproc/Resource/ProjectsRegionsJobs.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 248 lines | 77 code | 4 blank | 167 comment | 0 complexity | caad8cbf7f086c19c893b2aee5874d7b MD5 | raw file
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Dataproc\Resource;
  18. use Google\Service\Dataproc\CancelJobRequest;
  19. use Google\Service\Dataproc\DataprocEmpty;
  20. use Google\Service\Dataproc\GetIamPolicyRequest;
  21. use Google\Service\Dataproc\Job;
  22. use Google\Service\Dataproc\ListJobsResponse;
  23. use Google\Service\Dataproc\Operation;
  24. use Google\Service\Dataproc\Policy;
  25. use Google\Service\Dataproc\SetIamPolicyRequest;
  26. use Google\Service\Dataproc\SubmitJobRequest;
  27. use Google\Service\Dataproc\TestIamPermissionsRequest;
  28. use Google\Service\Dataproc\TestIamPermissionsResponse;
  29. /**
  30. * The "jobs" collection of methods.
  31. * Typical usage is:
  32. * <code>
  33. * $dataprocService = new Google\Service\Dataproc(...);
  34. * $jobs = $dataprocService->jobs;
  35. * </code>
  36. */
  37. class ProjectsRegionsJobs extends \Google\Service\Resource
  38. {
  39. /**
  40. * Starts a job cancellation request. To access the job resource after
  41. * cancellation, call regions/{region}/jobs.list (https://cloud.google.com/datap
  42. * roc/docs/reference/rest/v1/projects.regions.jobs/list) or
  43. * regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/r
  44. * est/v1/projects.regions.jobs/get). (jobs.cancel)
  45. *
  46. * @param string $projectId Required. The ID of the Google Cloud Platform
  47. * project that the job belongs to.
  48. * @param string $region Required. The Dataproc region in which to handle the
  49. * request.
  50. * @param string $jobId Required. The job ID.
  51. * @param CancelJobRequest $postBody
  52. * @param array $optParams Optional parameters.
  53. * @return Job
  54. */
  55. public function cancel($projectId, $region, $jobId, CancelJobRequest $postBody, $optParams = [])
  56. {
  57. $params = ['projectId' => $projectId, 'region' => $region, 'jobId' => $jobId, 'postBody' => $postBody];
  58. $params = array_merge($params, $optParams);
  59. return $this->call('cancel', [$params], Job::class);
  60. }
  61. /**
  62. * Deletes the job from the project. If the job is active, the delete fails, and
  63. * the response returns FAILED_PRECONDITION. (jobs.delete)
  64. *
  65. * @param string $projectId Required. The ID of the Google Cloud Platform
  66. * project that the job belongs to.
  67. * @param string $region Required. The Dataproc region in which to handle the
  68. * request.
  69. * @param string $jobId Required. The job ID.
  70. * @param array $optParams Optional parameters.
  71. * @return DataprocEmpty
  72. */
  73. public function delete($projectId, $region, $jobId, $optParams = [])
  74. {
  75. $params = ['projectId' => $projectId, 'region' => $region, 'jobId' => $jobId];
  76. $params = array_merge($params, $optParams);
  77. return $this->call('delete', [$params], DataprocEmpty::class);
  78. }
  79. /**
  80. * Gets the resource representation for a job in a project. (jobs.get)
  81. *
  82. * @param string $projectId Required. The ID of the Google Cloud Platform
  83. * project that the job belongs to.
  84. * @param string $region Required. The Dataproc region in which to handle the
  85. * request.
  86. * @param string $jobId Required. The job ID.
  87. * @param array $optParams Optional parameters.
  88. * @return Job
  89. */
  90. public function get($projectId, $region, $jobId, $optParams = [])
  91. {
  92. $params = ['projectId' => $projectId, 'region' => $region, 'jobId' => $jobId];
  93. $params = array_merge($params, $optParams);
  94. return $this->call('get', [$params], Job::class);
  95. }
  96. /**
  97. * Gets the access control policy for a resource. Returns an empty policy if the
  98. * resource exists and does not have a policy set. (jobs.getIamPolicy)
  99. *
  100. * @param string $resource REQUIRED: The resource for which the policy is being
  101. * requested. See the operation documentation for the appropriate value for this
  102. * field.
  103. * @param GetIamPolicyRequest $postBody
  104. * @param array $optParams Optional parameters.
  105. * @return Policy
  106. */
  107. public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
  108. {
  109. $params = ['resource' => $resource, 'postBody' => $postBody];
  110. $params = array_merge($params, $optParams);
  111. return $this->call('getIamPolicy', [$params], Policy::class);
  112. }
  113. /**
  114. * Lists regions/{region}/jobs in a project. (jobs.listProjectsRegionsJobs)
  115. *
  116. * @param string $projectId Required. The ID of the Google Cloud Platform
  117. * project that the job belongs to.
  118. * @param string $region Required. The Dataproc region in which to handle the
  119. * request.
  120. * @param array $optParams Optional parameters.
  121. *
  122. * @opt_param string clusterName Optional. If set, the returned jobs list
  123. * includes only jobs that were submitted to the named cluster.
  124. * @opt_param string filter Optional. A filter constraining the jobs to list.
  125. * Filters are case-sensitive and have the following syntax:field = value AND
  126. * field = value ...where field is status.state or labels.[KEY], and [KEY] is a
  127. * label key. value can be * to match all values. status.state can be either
  128. * ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-
  129. * separated items are treated as having an implicit AND operator.Example
  130. * filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = *
  131. * @opt_param string jobStateMatcher Optional. Specifies enumerated categories
  132. * of jobs to list. (default = match ALL jobs).If filter is provided,
  133. * jobStateMatcher will be ignored.
  134. * @opt_param int pageSize Optional. The number of results to return in each
  135. * response.
  136. * @opt_param string pageToken Optional. The page token, returned by a previous
  137. * call, to request the next page of results.
  138. * @return ListJobsResponse
  139. */
  140. public function listProjectsRegionsJobs($projectId, $region, $optParams = [])
  141. {
  142. $params = ['projectId' => $projectId, 'region' => $region];
  143. $params = array_merge($params, $optParams);
  144. return $this->call('list', [$params], ListJobsResponse::class);
  145. }
  146. /**
  147. * Updates a job in a project. (jobs.patch)
  148. *
  149. * @param string $projectId Required. The ID of the Google Cloud Platform
  150. * project that the job belongs to.
  151. * @param string $region Required. The Dataproc region in which to handle the
  152. * request.
  153. * @param string $jobId Required. The job ID.
  154. * @param Job $postBody
  155. * @param array $optParams Optional parameters.
  156. *
  157. * @opt_param string updateMask Required. Specifies the path, relative to Job,
  158. * of the field to update. For example, to update the labels of a Job the
  159. * update_mask parameter would be specified as labels, and the PATCH request
  160. * body would specify the new value. *Note:* Currently, labels is the only field
  161. * that can be updated.
  162. * @return Job
  163. */
  164. public function patch($projectId, $region, $jobId, Job $postBody, $optParams = [])
  165. {
  166. $params = ['projectId' => $projectId, 'region' => $region, 'jobId' => $jobId, 'postBody' => $postBody];
  167. $params = array_merge($params, $optParams);
  168. return $this->call('patch', [$params], Job::class);
  169. }
  170. /**
  171. * Sets the access control policy on the specified resource. Replaces any
  172. * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
  173. * errors. (jobs.setIamPolicy)
  174. *
  175. * @param string $resource REQUIRED: The resource for which the policy is being
  176. * specified. See the operation documentation for the appropriate value for this
  177. * field.
  178. * @param SetIamPolicyRequest $postBody
  179. * @param array $optParams Optional parameters.
  180. * @return Policy
  181. */
  182. public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
  183. {
  184. $params = ['resource' => $resource, 'postBody' => $postBody];
  185. $params = array_merge($params, $optParams);
  186. return $this->call('setIamPolicy', [$params], Policy::class);
  187. }
  188. /**
  189. * Submits a job to a cluster. (jobs.submit)
  190. *
  191. * @param string $projectId Required. The ID of the Google Cloud Platform
  192. * project that the job belongs to.
  193. * @param string $region Required. The Dataproc region in which to handle the
  194. * request.
  195. * @param SubmitJobRequest $postBody
  196. * @param array $optParams Optional parameters.
  197. * @return Job
  198. */
  199. public function submit($projectId, $region, SubmitJobRequest $postBody, $optParams = [])
  200. {
  201. $params = ['projectId' => $projectId, 'region' => $region, 'postBody' => $postBody];
  202. $params = array_merge($params, $optParams);
  203. return $this->call('submit', [$params], Job::class);
  204. }
  205. /**
  206. * Submits job to a cluster. (jobs.submitAsOperation)
  207. *
  208. * @param string $projectId Required. The ID of the Google Cloud Platform
  209. * project that the job belongs to.
  210. * @param string $region Required. The Dataproc region in which to handle the
  211. * request.
  212. * @param SubmitJobRequest $postBody
  213. * @param array $optParams Optional parameters.
  214. * @return Operation
  215. */
  216. public function submitAsOperation($projectId, $region, SubmitJobRequest $postBody, $optParams = [])
  217. {
  218. $params = ['projectId' => $projectId, 'region' => $region, 'postBody' => $postBody];
  219. $params = array_merge($params, $optParams);
  220. return $this->call('submitAsOperation', [$params], Operation::class);
  221. }
  222. /**
  223. * Returns permissions that a caller has on the specified resource. If the
  224. * resource does not exist, this will return an empty set of permissions, not a
  225. * NOT_FOUND error.Note: This operation is designed to be used for building
  226. * permission-aware UIs and command-line tools, not for authorization checking.
  227. * This operation may "fail open" without warning. (jobs.testIamPermissions)
  228. *
  229. * @param string $resource REQUIRED: The resource for which the policy detail is
  230. * being requested. See the operation documentation for the appropriate value
  231. * for this field.
  232. * @param TestIamPermissionsRequest $postBody
  233. * @param array $optParams Optional parameters.
  234. * @return TestIamPermissionsResponse
  235. */
  236. public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
  237. {
  238. $params = ['resource' => $resource, 'postBody' => $postBody];
  239. $params = array_merge($params, $optParams);
  240. return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
  241. }
  242. }
  243. // Adding a class alias for backwards compatibility with the previous class name.
  244. class_alias(ProjectsRegionsJobs::class, 'Google_Service_Dataproc_Resource_ProjectsRegionsJobs');