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 |
|
---|
18 | namespace Google\Service\Batch\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Batch\Job;
|
---|
21 | use Google\Service\Batch\ListJobsResponse;
|
---|
22 | use Google\Service\Batch\Operation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "jobs" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $batchService = new Google\Service\Batch(...);
|
---|
29 | * $jobs = $batchService->projects_locations_jobs;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsJobs extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Create a Job. (jobs.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. The parent resource name where the Job will
|
---|
38 | * be created. Pattern: "projects/{project}/locations/{location}"
|
---|
39 | * @param Job $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string jobId ID used to uniquely identify the Job within its
|
---|
43 | * parent scope. This field should contain at most 63 characters and must start
|
---|
44 | * with lowercase characters. Only lowercase characters, numbers and '-' are
|
---|
45 | * accepted. The '-' character cannot be the first or the last one. A system
|
---|
46 | * generated ID will be used if the field is not set. The job.name field in the
|
---|
47 | * request will be ignored and the created resource name of the Job will be
|
---|
48 | * "{parent}/jobs/{job_id}".
|
---|
49 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
50 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
51 | * the server will know to ignore the request if it has already been completed.
|
---|
52 | * The server will guarantee that for at least 60 minutes since the first
|
---|
53 | * request. For example, consider a situation where you make an initial request
|
---|
54 | * and the request times out. If you make the request again with the same
|
---|
55 | * request ID, the server can check if original operation with the same request
|
---|
56 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
57 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
58 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
59 | * (00000000-0000-0000-0000-000000000000).
|
---|
60 | * @return Job
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function create($parent, Job $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('create', [$params], Job::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Delete a Job. (jobs.delete)
|
---|
71 | *
|
---|
72 | * @param string $name Job name.
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | *
|
---|
75 | * @opt_param string reason Optional. Reason for this deletion.
|
---|
76 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
77 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
78 | * the server will know to ignore the request if it has already been completed.
|
---|
79 | * The server will guarantee that for at least 60 minutes after the first
|
---|
80 | * request. For example, consider a situation where you make an initial request
|
---|
81 | * and the request times out. If you make the request again with the same
|
---|
82 | * request ID, the server can check if original operation with the same request
|
---|
83 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
84 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
85 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
86 | * (00000000-0000-0000-0000-000000000000).
|
---|
87 | * @return Operation
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function delete($name, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('delete', [$params], Operation::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Get a Job specified by its resource name. (jobs.get)
|
---|
98 | *
|
---|
99 | * @param string $name Required. Job name.
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | * @return Job
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function get($name, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['name' => $name];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('get', [$params], Job::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * List all Jobs for a project within a region. (jobs.listProjectsLocationsJobs)
|
---|
112 | *
|
---|
113 | * @param string $parent Parent path.
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | *
|
---|
116 | * @opt_param string filter List filter.
|
---|
117 | * @opt_param string orderBy Optional. Sort results. Supported are "name", "name
|
---|
118 | * desc", "create_time", and "create_time desc".
|
---|
119 | * @opt_param int pageSize Page size.
|
---|
120 | * @opt_param string pageToken Page token.
|
---|
121 | * @return ListJobsResponse
|
---|
122 | * @throws \Google\Service\Exception
|
---|
123 | */
|
---|
124 | public function listProjectsLocationsJobs($parent, $optParams = [])
|
---|
125 | {
|
---|
126 | $params = ['parent' => $parent];
|
---|
127 | $params = array_merge($params, $optParams);
|
---|
128 | return $this->call('list', [$params], ListJobsResponse::class);
|
---|
129 | }
|
---|
130 | }
|
---|
131 |
|
---|
132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
133 | class_alias(ProjectsLocationsJobs::class, 'Google_Service_Batch_Resource_ProjectsLocationsJobs');
|
---|