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