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\Comment;
|
---|
21 | use Google\Service\Drive\CommentList;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "comments" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $driveService = new Google\Service\Drive(...);
|
---|
28 | * $comments = $driveService->comments;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Comments extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates a comment on a file. (comments.create)
|
---|
35 | *
|
---|
36 | * @param string $fileId The ID of the file.
|
---|
37 | * @param Comment $postBody
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return Comment
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function create($fileId, Comment $postBody, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['fileId' => $fileId, 'postBody' => $postBody];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('create', [$params], Comment::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Deletes a comment. (comments.delete)
|
---|
50 | *
|
---|
51 | * @param string $fileId The ID of the file.
|
---|
52 | * @param string $commentId The ID of the comment.
|
---|
53 | * @param array $optParams Optional parameters.
|
---|
54 | * @throws \Google\Service\Exception
|
---|
55 | */
|
---|
56 | public function delete($fileId, $commentId, $optParams = [])
|
---|
57 | {
|
---|
58 | $params = ['fileId' => $fileId, 'commentId' => $commentId];
|
---|
59 | $params = array_merge($params, $optParams);
|
---|
60 | return $this->call('delete', [$params]);
|
---|
61 | }
|
---|
62 | /**
|
---|
63 | * Gets a comment by ID. (comments.get)
|
---|
64 | *
|
---|
65 | * @param string $fileId The ID of the file.
|
---|
66 | * @param string $commentId The ID of the comment.
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | *
|
---|
69 | * @opt_param bool includeDeleted Whether to return deleted comments. Deleted
|
---|
70 | * comments will not include their original content.
|
---|
71 | * @return Comment
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function get($fileId, $commentId, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['fileId' => $fileId, 'commentId' => $commentId];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('get', [$params], Comment::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Lists a file's comments. (comments.listComments)
|
---|
82 | *
|
---|
83 | * @param string $fileId The ID of the file.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | *
|
---|
86 | * @opt_param bool includeDeleted Whether to include deleted comments. Deleted
|
---|
87 | * comments will not include their original content.
|
---|
88 | * @opt_param int pageSize The maximum number of comments to return per page.
|
---|
89 | * @opt_param string pageToken The token for continuing a previous list request
|
---|
90 | * on the next page. This should be set to the value of 'nextPageToken' from the
|
---|
91 | * previous response.
|
---|
92 | * @opt_param string startModifiedTime The minimum value of 'modifiedTime' for
|
---|
93 | * the result comments (RFC 3339 date-time).
|
---|
94 | * @return CommentList
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function listComments($fileId, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['fileId' => $fileId];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('list', [$params], CommentList::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Updates a comment with patch semantics. (comments.update)
|
---|
105 | *
|
---|
106 | * @param string $fileId The ID of the file.
|
---|
107 | * @param string $commentId The ID of the comment.
|
---|
108 | * @param Comment $postBody
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | * @return Comment
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function update($fileId, $commentId, Comment $postBody, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('update', [$params], Comment::class);
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
122 | class_alias(Comments::class, 'Google_Service_Drive_Resource_Comments');
|
---|