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\VMMigrationService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\VMMigrationService\ListTargetProjectsResponse;
|
---|
21 | use Google\Service\VMMigrationService\Operation;
|
---|
22 | use Google\Service\VMMigrationService\TargetProject;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "targetProjects" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $vmmigrationService = new Google\Service\VMMigrationService(...);
|
---|
29 | * $targetProjects = $vmmigrationService->projects_locations_targetProjects;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsTargetProjects extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new TargetProject in a given project. NOTE: TargetProject is a
|
---|
36 | * global resource; hence the only supported value for location is `global`.
|
---|
37 | * (targetProjects.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The TargetProject's parent.
|
---|
40 | * @param TargetProject $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
44 | * unique request ID so that if you must retry your request, the server will
|
---|
45 | * know to ignore the request if it has already been completed. The server will
|
---|
46 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
47 | * consider a situation where you make an initial request and the request times
|
---|
48 | * out. If you make the request again with the same request ID, the server can
|
---|
49 | * check if original operation with the same request ID was received, and if so,
|
---|
50 | * will ignore the second request. This prevents clients from accidentally
|
---|
51 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
52 | * exception that zero UUID is not supported
|
---|
53 | * (00000000-0000-0000-0000-000000000000).
|
---|
54 | * @opt_param string targetProjectId Required. The target_project identifier.
|
---|
55 | * @return Operation
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, TargetProject $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 a single TargetProject. NOTE: TargetProject is a global resource;
|
---|
66 | * hence the only supported value for location is `global`.
|
---|
67 | * (targetProjects.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The TargetProject name.
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | *
|
---|
72 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
73 | * Specify a unique request ID so that if you must retry your request, the
|
---|
74 | * server will know to ignore the request if it has already been completed. The
|
---|
75 | * server will guarantee that for at least 60 minutes after the first request.
|
---|
76 | * For example, consider a situation where you make an initial request and the
|
---|
77 | * request times out. If you make the request again with the same request ID,
|
---|
78 | * the server can check if original operation with the same request ID was
|
---|
79 | * received, and if so, will ignore the second request. This prevents clients
|
---|
80 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
81 | * valid UUID with the exception that zero UUID is not supported
|
---|
82 | * (00000000-0000-0000-0000-000000000000).
|
---|
83 | * @return Operation
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function delete($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('delete', [$params], Operation::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Gets details of a single TargetProject. NOTE: TargetProject is a global
|
---|
94 | * resource; hence the only supported value for location is `global`.
|
---|
95 | * (targetProjects.get)
|
---|
96 | *
|
---|
97 | * @param string $name Required. The TargetProject name.
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return TargetProject
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function get($name, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['name' => $name];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('get', [$params], TargetProject::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Lists TargetProjects in a given project. NOTE: TargetProject is a global
|
---|
110 | * resource; hence the only supported value for location is `global`.
|
---|
111 | * (targetProjects.listProjectsLocationsTargetProjects)
|
---|
112 | *
|
---|
113 | * @param string $parent Required. The parent, which owns this collection of
|
---|
114 | * targets.
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param string filter Optional. The filter request.
|
---|
118 | * @opt_param string orderBy Optional. the order by fields for the result.
|
---|
119 | * @opt_param int pageSize Optional. The maximum number of targets to return.
|
---|
120 | * The service may return fewer than this value. If unspecified, at most 500
|
---|
121 | * targets will be returned. The maximum value is 1000; values above 1000 will
|
---|
122 | * be coerced to 1000.
|
---|
123 | * @opt_param string pageToken Required. A page token, received from a previous
|
---|
124 | * `ListTargets` call. Provide this to retrieve the subsequent page. When
|
---|
125 | * paginating, all other parameters provided to `ListTargets` must match the
|
---|
126 | * call that provided the page token.
|
---|
127 | * @return ListTargetProjectsResponse
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function listProjectsLocationsTargetProjects($parent, $optParams = [])
|
---|
131 | {
|
---|
132 | $params = ['parent' => $parent];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('list', [$params], ListTargetProjectsResponse::class);
|
---|
135 | }
|
---|
136 | /**
|
---|
137 | * Updates the parameters of a single TargetProject. NOTE: TargetProject is a
|
---|
138 | * global resource; hence the only supported value for location is `global`.
|
---|
139 | * (targetProjects.patch)
|
---|
140 | *
|
---|
141 | * @param string $name Output only. The name of the target project.
|
---|
142 | * @param TargetProject $postBody
|
---|
143 | * @param array $optParams Optional parameters.
|
---|
144 | *
|
---|
145 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
146 | * unique request ID so that if you must retry your request, the server will
|
---|
147 | * know to ignore the request if it has already been completed. The server will
|
---|
148 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
149 | * consider a situation where you make an initial request and the request times
|
---|
150 | * out. If you make the request again with the same request ID, the server can
|
---|
151 | * check if original operation with the same request ID was received, and if so,
|
---|
152 | * will ignore the second request. This prevents clients from accidentally
|
---|
153 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
154 | * exception that zero UUID is not supported
|
---|
155 | * (00000000-0000-0000-0000-000000000000).
|
---|
156 | * @opt_param string updateMask Field mask is used to specify the fields to be
|
---|
157 | * overwritten in the TargetProject resource by the update. The fields specified
|
---|
158 | * in the update_mask are relative to the resource, not the full request. A
|
---|
159 | * field will be overwritten if it is in the mask. If the user does not provide
|
---|
160 | * a mask then all fields will be overwritten.
|
---|
161 | * @return Operation
|
---|
162 | * @throws \Google\Service\Exception
|
---|
163 | */
|
---|
164 | public function patch($name, TargetProject $postBody, $optParams = [])
|
---|
165 | {
|
---|
166 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
167 | $params = array_merge($params, $optParams);
|
---|
168 | return $this->call('patch', [$params], Operation::class);
|
---|
169 | }
|
---|
170 | }
|
---|
171 |
|
---|
172 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
173 | class_alias(ProjectsLocationsTargetProjects::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsTargetProjects');
|
---|