[e3d4e0a] | 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\AppHub\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\AppHub\Application;
|
---|
| 21 | use Google\Service\AppHub\ListApplicationsResponse;
|
---|
| 22 | use Google\Service\AppHub\Operation;
|
---|
| 23 | use Google\Service\AppHub\Policy;
|
---|
| 24 | use Google\Service\AppHub\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\AppHub\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\AppHub\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "applications" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $apphubService = new Google\Service\AppHub(...);
|
---|
| 33 | * $applications = $apphubService->projects_locations_applications;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsApplications extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates an Application in a host project and location. (applications.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. Project and location to create Application
|
---|
| 42 | * in. Expected format: `projects/{project}/locations/{location}`.
|
---|
| 43 | * @param Application $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string applicationId Required. The Application identifier. Must
|
---|
| 47 | * contain only lowercase letters, numbers or hyphens, with the first character
|
---|
| 48 | * a letter, the last a letter or a number, and a 63 character maximum.
|
---|
| 49 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 50 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 51 | * the server will know to ignore the request if it has already been completed.
|
---|
| 52 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 53 | * request. For example, consider a situation where you make an initial request
|
---|
| 54 | * and the request times out. If you make the request again with the same
|
---|
| 55 | * request ID, the server can check if original operation with the same request
|
---|
| 56 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 57 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 58 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 59 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, Application $postBody, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('create', [$params], Operation::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Deletes an Application in a host project and location. (applications.delete)
|
---|
| 71 | *
|
---|
| 72 | * @param string $name Required. Fully qualified name of the Application to
|
---|
| 73 | * delete. Expected format:
|
---|
| 74 | * `projects/{project}/locations/{location}/applications/{application}`.
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | *
|
---|
| 77 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 78 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 79 | * the server will know to ignore the request if it has already been completed.
|
---|
| 80 | * The server will guarantee that for at least 60 minutes after the first
|
---|
| 81 | * request. For example, consider a situation where you make an initial request
|
---|
| 82 | * and the request times out. If you make the request again with the same
|
---|
| 83 | * request ID, the server can check if original operation with the same request
|
---|
| 84 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 85 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 86 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 87 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 88 | * @return Operation
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function delete($name, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['name' => $name];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('delete', [$params], Operation::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Gets an Application in a host project and location. (applications.get)
|
---|
| 99 | *
|
---|
| 100 | * @param string $name Required. Fully qualified name of the Application to
|
---|
| 101 | * fetch. Expected format:
|
---|
| 102 | * `projects/{project}/locations/{location}/applications/{application}`.
|
---|
| 103 | * @param array $optParams Optional parameters.
|
---|
| 104 | * @return Application
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function get($name, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['name' => $name];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('get', [$params], Application::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 115 | * resource exists and does not have a policy set. (applications.getIamPolicy)
|
---|
| 116 | *
|
---|
| 117 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 118 | * requested. See [Resource
|
---|
| 119 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 120 | * appropriate value for this field.
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | *
|
---|
| 123 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 124 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 125 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 126 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 127 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 128 | * unset. The policy in the response might use the policy version that you
|
---|
| 129 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 130 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 131 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 132 | * IAM policies, see the [IAM
|
---|
| 133 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 134 | * policies).
|
---|
| 135 | * @return Policy
|
---|
| 136 | * @throws \Google\Service\Exception
|
---|
| 137 | */
|
---|
| 138 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 139 | {
|
---|
| 140 | $params = ['resource' => $resource];
|
---|
| 141 | $params = array_merge($params, $optParams);
|
---|
| 142 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 143 | }
|
---|
| 144 | /**
|
---|
| 145 | * Lists Applications in a host project and location.
|
---|
| 146 | * (applications.listProjectsLocationsApplications)
|
---|
| 147 | *
|
---|
| 148 | * @param string $parent Required. Project and location to list Applications on.
|
---|
| 149 | * Expected format: `projects/{project}/locations/{location}`.
|
---|
| 150 | * @param array $optParams Optional parameters.
|
---|
| 151 | *
|
---|
| 152 | * @opt_param string filter Optional. Filtering results.
|
---|
| 153 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
| 154 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
| 155 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
| 156 | * default.
|
---|
| 157 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 158 | * the server should return.
|
---|
| 159 | * @return ListApplicationsResponse
|
---|
| 160 | * @throws \Google\Service\Exception
|
---|
| 161 | */
|
---|
| 162 | public function listProjectsLocationsApplications($parent, $optParams = [])
|
---|
| 163 | {
|
---|
| 164 | $params = ['parent' => $parent];
|
---|
| 165 | $params = array_merge($params, $optParams);
|
---|
| 166 | return $this->call('list', [$params], ListApplicationsResponse::class);
|
---|
| 167 | }
|
---|
| 168 | /**
|
---|
| 169 | * Updates an Application in a host project and location. (applications.patch)
|
---|
| 170 | *
|
---|
| 171 | * @param string $name Identifier. The resource name of an Application. Format:
|
---|
| 172 | * `"projects/{host-project-id}/locations/{location}/applications/{application-
|
---|
| 173 | * id}"`
|
---|
| 174 | * @param Application $postBody
|
---|
| 175 | * @param array $optParams Optional parameters.
|
---|
| 176 | *
|
---|
| 177 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 178 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 179 | * the server will know to ignore the request if it has already been completed.
|
---|
| 180 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 181 | * request. For example, consider a situation where you make an initial request
|
---|
| 182 | * and the request times out. If you make the request again with the same
|
---|
| 183 | * request ID, the server can check if original operation with the same request
|
---|
| 184 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 185 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 186 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 187 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 188 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 189 | * fields to be overwritten in the Application resource by the update. The
|
---|
| 190 | * fields specified in the update_mask are relative to the resource, not the
|
---|
| 191 | * full request. The API changes the values of the fields as specified in the
|
---|
| 192 | * update_mask. The API ignores the values of all fields not covered by the
|
---|
| 193 | * update_mask. You can also unset a field by not specifying it in the updated
|
---|
| 194 | * message, but adding the field to the mask. This clears whatever value the
|
---|
| 195 | * field previously had.
|
---|
| 196 | * @return Operation
|
---|
| 197 | * @throws \Google\Service\Exception
|
---|
| 198 | */
|
---|
| 199 | public function patch($name, Application $postBody, $optParams = [])
|
---|
| 200 | {
|
---|
| 201 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 202 | $params = array_merge($params, $optParams);
|
---|
| 203 | return $this->call('patch', [$params], Operation::class);
|
---|
| 204 | }
|
---|
| 205 | /**
|
---|
| 206 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 207 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 208 | * `PERMISSION_DENIED` errors. (applications.setIamPolicy)
|
---|
| 209 | *
|
---|
| 210 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 211 | * specified. See [Resource
|
---|
| 212 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 213 | * appropriate value for this field.
|
---|
| 214 | * @param SetIamPolicyRequest $postBody
|
---|
| 215 | * @param array $optParams Optional parameters.
|
---|
| 216 | * @return Policy
|
---|
| 217 | * @throws \Google\Service\Exception
|
---|
| 218 | */
|
---|
| 219 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 220 | {
|
---|
| 221 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 222 | $params = array_merge($params, $optParams);
|
---|
| 223 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 224 | }
|
---|
| 225 | /**
|
---|
| 226 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 227 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 228 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 229 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 230 | * This operation may "fail open" without warning.
|
---|
| 231 | * (applications.testIamPermissions)
|
---|
| 232 | *
|
---|
| 233 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 234 | * being requested. See [Resource
|
---|
| 235 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 236 | * appropriate value for this field.
|
---|
| 237 | * @param TestIamPermissionsRequest $postBody
|
---|
| 238 | * @param array $optParams Optional parameters.
|
---|
| 239 | * @return TestIamPermissionsResponse
|
---|
| 240 | * @throws \Google\Service\Exception
|
---|
| 241 | */
|
---|
| 242 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 243 | {
|
---|
| 244 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 245 | $params = array_merge($params, $optParams);
|
---|
| 246 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 247 | }
|
---|
| 248 | }
|
---|
| 249 |
|
---|
| 250 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 251 | class_alias(ProjectsLocationsApplications::class, 'Google_Service_AppHub_Resource_ProjectsLocationsApplications');
|
---|