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\MigrationCenterAPI\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\MigrationCenterAPI\ImportJob;
|
---|
21 | use Google\Service\MigrationCenterAPI\ListImportJobsResponse;
|
---|
22 | use Google\Service\MigrationCenterAPI\Operation;
|
---|
23 | use Google\Service\MigrationCenterAPI\RunImportJobRequest;
|
---|
24 | use Google\Service\MigrationCenterAPI\ValidateImportJobRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "importJobs" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $migrationcenterService = new Google\Service\MigrationCenterAPI(...);
|
---|
31 | * $importJobs = $migrationcenterService->projects_locations_importJobs;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsImportJobs extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates an import job. (importJobs.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. Value for parent.
|
---|
40 | * @param ImportJob $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string importJobId Required. ID of the import job.
|
---|
44 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
45 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
46 | * the server will know to ignore the request if it has already been completed.
|
---|
47 | * The server will guarantee that for at least 60 minutes since the first
|
---|
48 | * request. For example, consider a situation where you make an initial request
|
---|
49 | * and the request times out. If you make the request again with the same
|
---|
50 | * request ID, the server can check if original operation with the same request
|
---|
51 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
52 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
53 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
54 | * (00000000-0000-0000-0000-000000000000).
|
---|
55 | * @return Operation
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, ImportJob $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('create', [$params], Operation::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Deletes an import job. (importJobs.delete)
|
---|
66 | *
|
---|
67 | * @param string $name Required. Name of the resource.
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | *
|
---|
70 | * @opt_param bool force Optional. If set to `true`, any `ImportDataFiles` of
|
---|
71 | * this job will also be deleted If set to `false`, the request only works if
|
---|
72 | * the job has no data files.
|
---|
73 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
74 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
75 | * the server will know to ignore the request if it has already been completed.
|
---|
76 | * The server will guarantee that for at least 60 minutes after the first
|
---|
77 | * request. For example, consider a situation where you make an initial request
|
---|
78 | * and the request times out. If you make the request again with the same
|
---|
79 | * request ID, the server can check if original operation with the same request
|
---|
80 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
81 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
82 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
83 | * (00000000-0000-0000-0000-000000000000).
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets the details of an import job. (importJobs.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. Name of the resource.
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param string view Optional. The level of details of the import job.
|
---|
100 | * Default value is FULL.
|
---|
101 | * @return ImportJob
|
---|
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], ImportJob::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Lists all import jobs. (importJobs.listProjectsLocationsImportJobs)
|
---|
112 | *
|
---|
113 | * @param string $parent Required. Parent value for `ListImportJobsRequest`.
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | *
|
---|
116 | * @opt_param string filter Filtering results.
|
---|
117 | * @opt_param string orderBy Field to sort by. See
|
---|
118 | * https://google.aip.dev/132#ordering for more details.
|
---|
119 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
120 | * than requested. If unspecified, server will pick an appropriate default.
|
---|
121 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
122 | * should return.
|
---|
123 | * @opt_param string view Optional. The level of details of each import job.
|
---|
124 | * Default value is BASIC.
|
---|
125 | * @return ListImportJobsResponse
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function listProjectsLocationsImportJobs($parent, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['parent' => $parent];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('list', [$params], ListImportJobsResponse::class);
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Updates an import job. (importJobs.patch)
|
---|
136 | *
|
---|
137 | * @param string $name Output only. The full name of the import job.
|
---|
138 | * @param ImportJob $postBody
|
---|
139 | * @param array $optParams Optional parameters.
|
---|
140 | *
|
---|
141 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
142 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
143 | * the server will know to ignore the request if it has already been completed.
|
---|
144 | * The server will guarantee that for at least 60 minutes since the first
|
---|
145 | * request. For example, consider a situation where you make an initial request
|
---|
146 | * and the request times out. If you make the request again with the same
|
---|
147 | * request ID, the server can check if original operation with the same request
|
---|
148 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
149 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
150 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
151 | * (00000000-0000-0000-0000-000000000000).
|
---|
152 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
153 | * fields to be overwritten in the `Asset` resource by the update. The values
|
---|
154 | * specified in the `update_mask` field are relative to the resource, not the
|
---|
155 | * full request. A field will be overwritten if it is in the mask. A single *
|
---|
156 | * value in the mask lets you to overwrite all fields.
|
---|
157 | * @return Operation
|
---|
158 | * @throws \Google\Service\Exception
|
---|
159 | */
|
---|
160 | public function patch($name, ImportJob $postBody, $optParams = [])
|
---|
161 | {
|
---|
162 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
163 | $params = array_merge($params, $optParams);
|
---|
164 | return $this->call('patch', [$params], Operation::class);
|
---|
165 | }
|
---|
166 | /**
|
---|
167 | * Runs an import job. (importJobs.run)
|
---|
168 | *
|
---|
169 | * @param string $name Required. The name of the import job to run.
|
---|
170 | * @param RunImportJobRequest $postBody
|
---|
171 | * @param array $optParams Optional parameters.
|
---|
172 | * @return Operation
|
---|
173 | * @throws \Google\Service\Exception
|
---|
174 | */
|
---|
175 | public function run($name, RunImportJobRequest $postBody, $optParams = [])
|
---|
176 | {
|
---|
177 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
178 | $params = array_merge($params, $optParams);
|
---|
179 | return $this->call('run', [$params], Operation::class);
|
---|
180 | }
|
---|
181 | /**
|
---|
182 | * Validates an import job. (importJobs.validate)
|
---|
183 | *
|
---|
184 | * @param string $name Required. The name of the import job to validate.
|
---|
185 | * @param ValidateImportJobRequest $postBody
|
---|
186 | * @param array $optParams Optional parameters.
|
---|
187 | * @return Operation
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function validate($name, ValidateImportJobRequest $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('validate', [$params], Operation::class);
|
---|
195 | }
|
---|
196 | }
|
---|
197 |
|
---|
198 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
199 | class_alias(ProjectsLocationsImportJobs::class, 'Google_Service_MigrationCenterAPI_Resource_ProjectsLocationsImportJobs');
|
---|