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