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\CloudDataplex\Resource;
19
20use Google\Service\CloudDataplex\GoogleCloudDataplexV1ListTasksResponse;
21use Google\Service\CloudDataplex\GoogleCloudDataplexV1Task;
22use Google\Service\CloudDataplex\GoogleIamV1Policy;
23use Google\Service\CloudDataplex\GoogleIamV1SetIamPolicyRequest;
24use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsRequest;
25use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsResponse;
26use Google\Service\CloudDataplex\GoogleLongrunningOperation;
27
28/**
29 * The "tasks" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $dataplexService = new Google\Service\CloudDataplex(...);
33 *   $tasks = $dataplexService->tasks;
34 *  </code>
35 */
36class ProjectsLocationsLakesTasks extends \Google\Service\Resource
37{
38  /**
39   * Creates a task resource within a lake. (tasks.create)
40   *
41   * @param string $parent Required. The resource name of the parent lake:
42   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
43   * @param GoogleCloudDataplexV1Task $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string taskId Required. Task identifier.
47   * @opt_param bool validateOnly Optional. Only validate the request, but do not
48   * perform mutations. The default is false.
49   * @return GoogleLongrunningOperation
50   */
51  public function create($parent, GoogleCloudDataplexV1Task $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('create', [$params], GoogleLongrunningOperation::class);
56  }
57  /**
58   * Delete the task resource. (tasks.delete)
59   *
60   * @param string $name Required. The resource name of the task:
61   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
62   * /task/{task_id}`
63   * @param array $optParams Optional parameters.
64   * @return GoogleLongrunningOperation
65   */
66  public function delete($name, $optParams = [])
67  {
68    $params = ['name' => $name];
69    $params = array_merge($params, $optParams);
70    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
71  }
72  /**
73   * Get task resource. (tasks.get)
74   *
75   * @param string $name Required. The resource name of the task:
76   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
77   * /tasks/{tasks_id}
78   * @param array $optParams Optional parameters.
79   * @return GoogleCloudDataplexV1Task
80   */
81  public function get($name, $optParams = [])
82  {
83    $params = ['name' => $name];
84    $params = array_merge($params, $optParams);
85    return $this->call('get', [$params], GoogleCloudDataplexV1Task::class);
86  }
87  /**
88   * Gets the access control policy for a resource. Returns an empty policy if the
89   * resource exists and does not have a policy set. (tasks.getIamPolicy)
90   *
91   * @param string $resource REQUIRED: The resource for which the policy is being
92   * requested. See the operation documentation for the appropriate value for this
93   * field.
94   * @param array $optParams Optional parameters.
95   *
96   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
97   * version that will be used to format the policy.Valid values are 0, 1, and 3.
98   * Requests specifying an invalid value will be rejected.Requests for policies
99   * with any conditional role bindings must specify version 3. Policies with no
100   * conditional role bindings may specify any valid value or leave the field
101   * unset.The policy in the response might use the policy version that you
102   * specified, or it might use a lower policy version. For example, if you
103   * specify version 3, but the policy has no conditional role bindings, the
104   * response uses version 1.To learn which resources support conditions in their
105   * IAM policies, see the IAM documentation
106   * (https://cloud.google.com/iam/help/conditions/resource-policies).
107   * @return GoogleIamV1Policy
108   */
109  public function getIamPolicy($resource, $optParams = [])
110  {
111    $params = ['resource' => $resource];
112    $params = array_merge($params, $optParams);
113    return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
114  }
115  /**
116   * Lists tasks under the given lake. (tasks.listProjectsLocationsLakesTasks)
117   *
118   * @param string $parent Required. The resource name of the parent lake:
119   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
120   * @param array $optParams Optional parameters.
121   *
122   * @opt_param string filter Optional. Filter request.
123   * @opt_param string orderBy Optional. Order by fields for the result.
124   * @opt_param int pageSize Optional. Maximum number of tasks to return. The
125   * service may return fewer than this value. If unspecified, at most 10 tasks
126   * will be returned. The maximum value is 1000; values above 1000 will be
127   * coerced to 1000.
128   * @opt_param string pageToken Optional. Page token received from a previous
129   * ListZones call. Provide this to retrieve the subsequent page. When
130   * paginating, all other parameters provided to ListZones must match the call
131   * that provided the page token.
132   * @return GoogleCloudDataplexV1ListTasksResponse
133   */
134  public function listProjectsLocationsLakesTasks($parent, $optParams = [])
135  {
136    $params = ['parent' => $parent];
137    $params = array_merge($params, $optParams);
138    return $this->call('list', [$params], GoogleCloudDataplexV1ListTasksResponse::class);
139  }
140  /**
141   * Update the task resource. (tasks.patch)
142   *
143   * @param string $name Output only. The relative resource name of the task, of
144   * the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/
145   * tasks/{task_id}.
146   * @param GoogleCloudDataplexV1Task $postBody
147   * @param array $optParams Optional parameters.
148   *
149   * @opt_param string updateMask Required. Mask of fields to update.
150   * @opt_param bool validateOnly Optional. Only validate the request, but do not
151   * perform mutations. The default is false.
152   * @return GoogleLongrunningOperation
153   */
154  public function patch($name, GoogleCloudDataplexV1Task $postBody, $optParams = [])
155  {
156    $params = ['name' => $name, 'postBody' => $postBody];
157    $params = array_merge($params, $optParams);
158    return $this->call('patch', [$params], GoogleLongrunningOperation::class);
159  }
160  /**
161   * Sets the access control policy on the specified resource. Replaces any
162   * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
163   * errors. (tasks.setIamPolicy)
164   *
165   * @param string $resource REQUIRED: The resource for which the policy is being
166   * specified. See the operation documentation for the appropriate value for this
167   * field.
168   * @param GoogleIamV1SetIamPolicyRequest $postBody
169   * @param array $optParams Optional parameters.
170   * @return GoogleIamV1Policy
171   */
172  public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
173  {
174    $params = ['resource' => $resource, 'postBody' => $postBody];
175    $params = array_merge($params, $optParams);
176    return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
177  }
178  /**
179   * Returns permissions that a caller has on the specified resource. If the
180   * resource does not exist, this will return an empty set of permissions, not a
181   * NOT_FOUND error.Note: This operation is designed to be used for building
182   * permission-aware UIs and command-line tools, not for authorization checking.
183   * This operation may "fail open" without warning. (tasks.testIamPermissions)
184   *
185   * @param string $resource REQUIRED: The resource for which the policy detail is
186   * being requested. See the operation documentation for the appropriate value
187   * for this field.
188   * @param GoogleIamV1TestIamPermissionsRequest $postBody
189   * @param array $optParams Optional parameters.
190   * @return GoogleIamV1TestIamPermissionsResponse
191   */
192  public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
193  {
194    $params = ['resource' => $resource, 'postBody' => $postBody];
195    $params = array_merge($params, $optParams);
196    return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
197  }
198}
199
200// Adding a class alias for backwards compatibility with the previous class name.
201class_alias(ProjectsLocationsLakesTasks::class, 'Google_Service_CloudDataplex_Resource_ProjectsLocationsLakesTasks');
202