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\Apigateway\Resource;
19
20use Google\Service\Apigateway\ApigatewayGateway;
21use Google\Service\Apigateway\ApigatewayListGatewaysResponse;
22use Google\Service\Apigateway\ApigatewayOperation;
23use Google\Service\Apigateway\ApigatewayPolicy;
24use Google\Service\Apigateway\ApigatewaySetIamPolicyRequest;
25use Google\Service\Apigateway\ApigatewayTestIamPermissionsRequest;
26use Google\Service\Apigateway\ApigatewayTestIamPermissionsResponse;
27
28/**
29 * The "gateways" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $apigatewayService = new Google\Service\Apigateway(...);
33 *   $gateways = $apigatewayService->gateways;
34 *  </code>
35 */
36class ProjectsLocationsGateways extends \Google\Service\Resource
37{
38  /**
39   * Creates a new Gateway in a given project and location. (gateways.create)
40   *
41   * @param string $parent Required. Parent resource of the Gateway, of the form:
42   * `projects/locations`
43   * @param ApigatewayGateway $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string gatewayId Required. Identifier to assign to the Gateway.
47   * Must be unique within scope of the parent resource.
48   * @return ApigatewayOperation
49   */
50  public function create($parent, ApigatewayGateway $postBody, $optParams = [])
51  {
52    $params = ['parent' => $parent, 'postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], ApigatewayOperation::class);
55  }
56  /**
57   * Deletes a single Gateway. (gateways.delete)
58   *
59   * @param string $name Required. Resource name of the form:
60   * `projects/locations/gateways`
61   * @param array $optParams Optional parameters.
62   * @return ApigatewayOperation
63   */
64  public function delete($name, $optParams = [])
65  {
66    $params = ['name' => $name];
67    $params = array_merge($params, $optParams);
68    return $this->call('delete', [$params], ApigatewayOperation::class);
69  }
70  /**
71   * Gets details of a single Gateway. (gateways.get)
72   *
73   * @param string $name Required. Resource name of the form:
74   * `projects/locations/gateways`
75   * @param array $optParams Optional parameters.
76   * @return ApigatewayGateway
77   */
78  public function get($name, $optParams = [])
79  {
80    $params = ['name' => $name];
81    $params = array_merge($params, $optParams);
82    return $this->call('get', [$params], ApigatewayGateway::class);
83  }
84  /**
85   * Gets the access control policy for a resource. Returns an empty policy if the
86   * resource exists and does not have a policy set. (gateways.getIamPolicy)
87   *
88   * @param string $resource REQUIRED: The resource for which the policy is being
89   * requested. See the operation documentation for the appropriate value for this
90   * field.
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
94   * version that will be used to format the policy. Valid values are 0, 1, and 3.
95   * Requests specifying an invalid value will be rejected. Requests for policies
96   * with any conditional role bindings must specify version 3. Policies with no
97   * conditional role bindings may specify any valid value or leave the field
98   * unset. The policy in the response might use the policy version that you
99   * specified, or it might use a lower policy version. For example, if you
100   * specify version 3, but the policy has no conditional role bindings, the
101   * response uses version 1. To learn which resources support conditions in their
102   * IAM policies, see the [IAM
103   * documentation](https://cloud.google.com/iam/help/conditions/resource-
104   * policies).
105   * @return ApigatewayPolicy
106   */
107  public function getIamPolicy($resource, $optParams = [])
108  {
109    $params = ['resource' => $resource];
110    $params = array_merge($params, $optParams);
111    return $this->call('getIamPolicy', [$params], ApigatewayPolicy::class);
112  }
113  /**
114   * Lists Gateways in a given project and location.
115   * (gateways.listProjectsLocationsGateways)
116   *
117   * @param string $parent Required. Parent resource of the Gateway, of the form:
118   * `projects/locations`
119   * @param array $optParams Optional parameters.
120   *
121   * @opt_param string filter Filter.
122   * @opt_param string orderBy Order by parameters.
123   * @opt_param int pageSize Page size.
124   * @opt_param string pageToken Page token.
125   * @return ApigatewayListGatewaysResponse
126   */
127  public function listProjectsLocationsGateways($parent, $optParams = [])
128  {
129    $params = ['parent' => $parent];
130    $params = array_merge($params, $optParams);
131    return $this->call('list', [$params], ApigatewayListGatewaysResponse::class);
132  }
133  /**
134   * Updates the parameters of a single Gateway. (gateways.patch)
135   *
136   * @param string $name Output only. Resource name of the Gateway. Format:
137   * projects/{project}/locations/{location}/gateways/{gateway}
138   * @param ApigatewayGateway $postBody
139   * @param array $optParams Optional parameters.
140   *
141   * @opt_param string updateMask Field mask is used to specify the fields to be
142   * overwritten in the Gateway resource by the update. The fields specified in
143   * the update_mask are relative to the resource, not the full request. A field
144   * will be overwritten if it is in the mask. If the user does not provide a mask
145   * then all fields will be overwritten.
146   * @return ApigatewayOperation
147   */
148  public function patch($name, ApigatewayGateway $postBody, $optParams = [])
149  {
150    $params = ['name' => $name, 'postBody' => $postBody];
151    $params = array_merge($params, $optParams);
152    return $this->call('patch', [$params], ApigatewayOperation::class);
153  }
154  /**
155   * Sets the access control policy on the specified resource. Replaces any
156   * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
157   * `PERMISSION_DENIED` errors. (gateways.setIamPolicy)
158   *
159   * @param string $resource REQUIRED: The resource for which the policy is being
160   * specified. See the operation documentation for the appropriate value for this
161   * field.
162   * @param ApigatewaySetIamPolicyRequest $postBody
163   * @param array $optParams Optional parameters.
164   * @return ApigatewayPolicy
165   */
166  public function setIamPolicy($resource, ApigatewaySetIamPolicyRequest $postBody, $optParams = [])
167  {
168    $params = ['resource' => $resource, 'postBody' => $postBody];
169    $params = array_merge($params, $optParams);
170    return $this->call('setIamPolicy', [$params], ApigatewayPolicy::class);
171  }
172  /**
173   * Returns permissions that a caller has on the specified resource. If the
174   * resource does not exist, this will return an empty set of permissions, not a
175   * `NOT_FOUND` error. Note: This operation is designed to be used for building
176   * permission-aware UIs and command-line tools, not for authorization checking.
177   * This operation may "fail open" without warning. (gateways.testIamPermissions)
178   *
179   * @param string $resource REQUIRED: The resource for which the policy detail is
180   * being requested. See the operation documentation for the appropriate value
181   * for this field.
182   * @param ApigatewayTestIamPermissionsRequest $postBody
183   * @param array $optParams Optional parameters.
184   * @return ApigatewayTestIamPermissionsResponse
185   */
186  public function testIamPermissions($resource, ApigatewayTestIamPermissionsRequest $postBody, $optParams = [])
187  {
188    $params = ['resource' => $resource, 'postBody' => $postBody];
189    $params = array_merge($params, $optParams);
190    return $this->call('testIamPermissions', [$params], ApigatewayTestIamPermissionsResponse::class);
191  }
192}
193
194// Adding a class alias for backwards compatibility with the previous class name.
195class_alias(ProjectsLocationsGateways::class, 'Google_Service_Apigateway_Resource_ProjectsLocationsGateways');
196