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\DriveLabels\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DriveLabels\GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest;
|
---|
21 | use Google\Service\DriveLabels\GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest;
|
---|
22 | use Google\Service\DriveLabels\GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse;
|
---|
23 | use Google\Service\DriveLabels\GoogleAppsDriveLabelsV2LabelPermission;
|
---|
24 | use Google\Service\DriveLabels\GoogleAppsDriveLabelsV2ListLabelPermissionsResponse;
|
---|
25 | use Google\Service\DriveLabels\GoogleProtobufEmpty;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "permissions" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $drivelabelsService = new Google\Service\DriveLabels(...);
|
---|
32 | * $permissions = $drivelabelsService->labels_permissions;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class LabelsPermissions extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Deletes Label permissions. Permissions affect the Label resource as a whole,
|
---|
39 | * are not revisioned, and do not require publishing. (permissions.batchDelete)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The parent Label resource name shared by all
|
---|
42 | * permissions being deleted. Format: labels/{label} If this is set, the parent
|
---|
43 | * field in the UpdateLabelPermissionRequest messages must either be empty or
|
---|
44 | * match this field.
|
---|
45 | * @param GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return GoogleProtobufEmpty
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function batchDelete($parent, GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('batchDelete', [$params], GoogleProtobufEmpty::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Updates Label permissions. If a permission for the indicated principal
|
---|
58 | * doesn't exist, a new Label Permission is created, otherwise the existing
|
---|
59 | * permission is updated. Permissions affect the Label resource as a whole, are
|
---|
60 | * not revisioned, and do not require publishing. (permissions.batchUpdate)
|
---|
61 | *
|
---|
62 | * @param string $parent Required. The parent Label resource name shared by all
|
---|
63 | * permissions being updated. Format: labels/{label} If this is set, the parent
|
---|
64 | * field in the UpdateLabelPermissionRequest messages must either be empty or
|
---|
65 | * match this field.
|
---|
66 | * @param GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest $postBody
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function batchUpdate($parent, GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('batchUpdate', [$params], GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Updates a Label's permissions. If a permission for the indicated principal
|
---|
79 | * doesn't exist, a new Label Permission is created, otherwise the existing
|
---|
80 | * permission is updated. Permissions affect the Label resource as a whole, are
|
---|
81 | * not revisioned, and do not require publishing. (permissions.create)
|
---|
82 | *
|
---|
83 | * @param string $parent Required. The parent Label resource name on the Label
|
---|
84 | * Permission is created. Format: labels/{label}
|
---|
85 | * @param GoogleAppsDriveLabelsV2LabelPermission $postBody
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | *
|
---|
88 | * @opt_param bool useAdminAccess Set to `true` in order to use the user's admin
|
---|
89 | * credentials. The server will verify the user is an admin for the Label before
|
---|
90 | * allowing access.
|
---|
91 | * @return GoogleAppsDriveLabelsV2LabelPermission
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function create($parent, GoogleAppsDriveLabelsV2LabelPermission $postBody, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('create', [$params], GoogleAppsDriveLabelsV2LabelPermission::class);
|
---|
99 | }
|
---|
100 | /**
|
---|
101 | * Deletes a Label's permission. Permissions affect the Label resource as a
|
---|
102 | * whole, are not revisioned, and do not require publishing.
|
---|
103 | * (permissions.delete)
|
---|
104 | *
|
---|
105 | * @param string $name Required. Label Permission resource name.
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | *
|
---|
108 | * @opt_param bool useAdminAccess Set to `true` in order to use the user's admin
|
---|
109 | * credentials. The server will verify the user is an admin for the Label before
|
---|
110 | * allowing access.
|
---|
111 | * @return GoogleProtobufEmpty
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function delete($name, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['name' => $name];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
119 | }
|
---|
120 | /**
|
---|
121 | * Lists a Label's permissions. (permissions.listLabelsPermissions)
|
---|
122 | *
|
---|
123 | * @param string $parent Required. The parent Label resource name on which Label
|
---|
124 | * Permission are listed. Format: labels/{label}
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | *
|
---|
127 | * @opt_param int pageSize Maximum number of permissions to return per page.
|
---|
128 | * Default: 50. Max: 200.
|
---|
129 | * @opt_param string pageToken The token of the page to return.
|
---|
130 | * @opt_param bool useAdminAccess Set to `true` in order to use the user's admin
|
---|
131 | * credentials. The server will verify the user is an admin for the Label before
|
---|
132 | * allowing access.
|
---|
133 | * @return GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
|
---|
134 | * @throws \Google\Service\Exception
|
---|
135 | */
|
---|
136 | public function listLabelsPermissions($parent, $optParams = [])
|
---|
137 | {
|
---|
138 | $params = ['parent' => $parent];
|
---|
139 | $params = array_merge($params, $optParams);
|
---|
140 | return $this->call('list', [$params], GoogleAppsDriveLabelsV2ListLabelPermissionsResponse::class);
|
---|
141 | }
|
---|
142 | }
|
---|
143 |
|
---|
144 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
145 | class_alias(LabelsPermissions::class, 'Google_Service_DriveLabels_Resource_LabelsPermissions');
|
---|