[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\Drive\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Drive\AccessProposal;
|
---|
| 21 | use Google\Service\Drive\ListAccessProposalsResponse;
|
---|
| 22 | use Google\Service\Drive\ResolveAccessProposalRequest;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "accessproposals" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $driveService = new Google\Service\Drive(...);
|
---|
| 29 | * $accessproposals = $driveService->accessproposals;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class Accessproposals extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Retrieves an AccessProposal by ID. (accessproposals.get)
|
---|
| 36 | *
|
---|
| 37 | * @param string $fileId Required. The id of the item the request is on.
|
---|
| 38 | * @param string $proposalId Required. The id of the access proposal to resolve.
|
---|
| 39 | * @param array $optParams Optional parameters.
|
---|
| 40 | * @return AccessProposal
|
---|
| 41 | * @throws \Google\Service\Exception
|
---|
| 42 | */
|
---|
| 43 | public function get($fileId, $proposalId, $optParams = [])
|
---|
| 44 | {
|
---|
| 45 | $params = ['fileId' => $fileId, 'proposalId' => $proposalId];
|
---|
| 46 | $params = array_merge($params, $optParams);
|
---|
| 47 | return $this->call('get', [$params], AccessProposal::class);
|
---|
| 48 | }
|
---|
| 49 | /**
|
---|
| 50 | * List the AccessProposals on a file. Note: Only approvers are able to list
|
---|
| 51 | * AccessProposals on a file. If the user is not an approver, returns a 403.
|
---|
| 52 | * (accessproposals.listAccessproposals)
|
---|
| 53 | *
|
---|
| 54 | * @param string $fileId Required. The id of the item the request is on.
|
---|
| 55 | * @param array $optParams Optional parameters.
|
---|
| 56 | *
|
---|
| 57 | * @opt_param int pageSize Optional. The number of results per page
|
---|
| 58 | * @opt_param string pageToken Optional. The continuation token on the list of
|
---|
| 59 | * access requests.
|
---|
| 60 | * @return ListAccessProposalsResponse
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function listAccessproposals($fileId, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['fileId' => $fileId];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('list', [$params], ListAccessProposalsResponse::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Used to approve or deny an Access Proposal. (accessproposals.resolve)
|
---|
| 71 | *
|
---|
| 72 | * @param string $fileId Required. The id of the item the request is on.
|
---|
| 73 | * @param string $proposalId Required. The id of the access proposal to resolve.
|
---|
| 74 | * @param ResolveAccessProposalRequest $postBody
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | * @throws \Google\Service\Exception
|
---|
| 77 | */
|
---|
| 78 | public function resolve($fileId, $proposalId, ResolveAccessProposalRequest $postBody, $optParams = [])
|
---|
| 79 | {
|
---|
| 80 | $params = ['fileId' => $fileId, 'proposalId' => $proposalId, 'postBody' => $postBody];
|
---|
| 81 | $params = array_merge($params, $optParams);
|
---|
| 82 | return $this->call('resolve', [$params]);
|
---|
| 83 | }
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 87 | class_alias(Accessproposals::class, 'Google_Service_Drive_Resource_Accessproposals');
|
---|