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