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\CloudIAP\Resource;
19
20use Google\Service\CloudIAP\IapEmpty;
21use Google\Service\CloudIAP\ListTunnelDestGroupsResponse;
22use Google\Service\CloudIAP\TunnelDestGroup;
23
24/**
25 * The "destGroups" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $iapService = new Google\Service\CloudIAP(...);
29 *   $destGroups = $iapService->destGroups;
30 *  </code>
31 */
32class ProjectsIapTunnelLocationsDestGroups extends \Google\Service\Resource
33{
34  /**
35   * Creates a new TunnelDestGroup. (destGroups.create)
36   *
37   * @param string $parent Required. GCP Project number/id and location. In the
38   * following format:
39   * projects/{project_number/id}/iap_tunnel/locations/{location}.
40   * @param TunnelDestGroup $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string tunnelDestGroupId Required. The ID to use for the
44   * TunnelDestGroup, which will become the final component of the resource name.
45   * This value should be 4-63 characters, and valid characters are /a-z-/.
46   * @return TunnelDestGroup
47   */
48  public function create($parent, TunnelDestGroup $postBody, $optParams = [])
49  {
50    $params = ['parent' => $parent, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], TunnelDestGroup::class);
53  }
54  /**
55   * Deletes a TunnelDestGroup. (destGroups.delete)
56   *
57   * @param string $name Required. Name of the TunnelDestGroup to be deleted. In
58   * the following format: projects/{project_number/id}/iap_tunnel/locations/{loca
59   * tion}/destGroups/{dest_group}.
60   * @param array $optParams Optional parameters.
61   * @return IapEmpty
62   */
63  public function delete($name, $optParams = [])
64  {
65    $params = ['name' => $name];
66    $params = array_merge($params, $optParams);
67    return $this->call('delete', [$params], IapEmpty::class);
68  }
69  /**
70   * Retrieves an existing TunnelDestGroup. (destGroups.get)
71   *
72   * @param string $name Required. Name of the TunnelDestGroup to be fetched. In
73   * the following format: projects/{project_number/id}/iap_tunnel/locations/{loca
74   * tion}/destGroups/{dest_group}.
75   * @param array $optParams Optional parameters.
76   * @return TunnelDestGroup
77   */
78  public function get($name, $optParams = [])
79  {
80    $params = ['name' => $name];
81    $params = array_merge($params, $optParams);
82    return $this->call('get', [$params], TunnelDestGroup::class);
83  }
84  /**
85   * Lists the existing TunnelDestGroups. To group across all locations, use a `-`
86   * as the location ID. For example:
87   * /v1/projects/123/iap_tunnel/locations/-/destGroups
88   * (destGroups.listProjectsIapTunnelLocationsDestGroups)
89   *
90   * @param string $parent Required. GCP Project number/id and location. In the
91   * following format:
92   * projects/{project_number/id}/iap_tunnel/locations/{location}. A `-` can be
93   * used for the location to group across all locations.
94   * @param array $optParams Optional parameters.
95   *
96   * @opt_param int pageSize The maximum number of groups to return. The service
97   * may return fewer than this value. If unspecified, at most 100 groups will be
98   * returned. The maximum value is 1000; values above 1000 will be coerced to
99   * 1000.
100   * @opt_param string pageToken A page token, received from a previous
101   * `ListTunnelDestGroups` call. Provide this to retrieve the subsequent page.
102   * When paginating, all other parameters provided to `ListTunnelDestGroups` must
103   * match the call that provided the page token.
104   * @return ListTunnelDestGroupsResponse
105   */
106  public function listProjectsIapTunnelLocationsDestGroups($parent, $optParams = [])
107  {
108    $params = ['parent' => $parent];
109    $params = array_merge($params, $optParams);
110    return $this->call('list', [$params], ListTunnelDestGroupsResponse::class);
111  }
112  /**
113   * Updates a TunnelDestGroup. (destGroups.patch)
114   *
115   * @param string $name Required. Immutable. Identifier for the TunnelDestGroup.
116   * Must be unique within the project.
117   * @param TunnelDestGroup $postBody
118   * @param array $optParams Optional parameters.
119   *
120   * @opt_param string updateMask The field mask specifying which IAP settings
121   * should be updated. If omitted, then all of the settings are updated. See
122   * https://developers.google.com/protocol-
123   * buffers/docs/reference/google.protobuf#fieldmask
124   * @return TunnelDestGroup
125   */
126  public function patch($name, TunnelDestGroup $postBody, $optParams = [])
127  {
128    $params = ['name' => $name, 'postBody' => $postBody];
129    $params = array_merge($params, $optParams);
130    return $this->call('patch', [$params], TunnelDestGroup::class);
131  }
132}
133
134// Adding a class alias for backwards compatibility with the previous class name.
135class_alias(ProjectsIapTunnelLocationsDestGroups::class, 'Google_Service_CloudIAP_Resource_ProjectsIapTunnelLocationsDestGroups');
136