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\Blogger\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Blogger\Comment;
|
---|
21 | use Google\Service\Blogger\CommentList;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "comments" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $bloggerService = new Google\Service\Blogger(...);
|
---|
28 | * $comments = $bloggerService->comments;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Comments extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Marks a comment as not spam by blog id, post id and comment id.
|
---|
35 | * (comments.approve)
|
---|
36 | *
|
---|
37 | * @param string $blogId
|
---|
38 | * @param string $postId
|
---|
39 | * @param string $commentId
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Comment
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function approve($blogId, $postId, $commentId, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('approve', [$params], Comment::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Deletes a comment by blog id, post id and comment id. (comments.delete)
|
---|
52 | *
|
---|
53 | * @param string $blogId
|
---|
54 | * @param string $postId
|
---|
55 | * @param string $commentId
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function delete($blogId, $postId, $commentId, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('delete', [$params]);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Gets a comment by id. (comments.get)
|
---|
67 | *
|
---|
68 | * @param string $blogId
|
---|
69 | * @param string $postId
|
---|
70 | * @param string $commentId
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param string view
|
---|
74 | * @return Comment
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function get($blogId, $postId, $commentId, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('get', [$params], Comment::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Lists comments. (comments.listComments)
|
---|
85 | *
|
---|
86 | * @param string $blogId
|
---|
87 | * @param string $postId
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | *
|
---|
90 | * @opt_param string endDate
|
---|
91 | * @opt_param bool fetchBodies
|
---|
92 | * @opt_param string maxResults
|
---|
93 | * @opt_param string pageToken
|
---|
94 | * @opt_param string startDate
|
---|
95 | * @opt_param string status
|
---|
96 | * @opt_param string view
|
---|
97 | * @return CommentList
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function listComments($blogId, $postId, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['blogId' => $blogId, 'postId' => $postId];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('list', [$params], CommentList::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Lists comments by blog. (comments.listByBlog)
|
---|
108 | *
|
---|
109 | * @param string $blogId
|
---|
110 | * @param array $optParams Optional parameters.
|
---|
111 | *
|
---|
112 | * @opt_param string endDate
|
---|
113 | * @opt_param bool fetchBodies
|
---|
114 | * @opt_param string maxResults
|
---|
115 | * @opt_param string pageToken
|
---|
116 | * @opt_param string startDate
|
---|
117 | * @opt_param string status
|
---|
118 | * @return CommentList
|
---|
119 | * @throws \Google\Service\Exception
|
---|
120 | */
|
---|
121 | public function listByBlog($blogId, $optParams = [])
|
---|
122 | {
|
---|
123 | $params = ['blogId' => $blogId];
|
---|
124 | $params = array_merge($params, $optParams);
|
---|
125 | return $this->call('listByBlog', [$params], CommentList::class);
|
---|
126 | }
|
---|
127 | /**
|
---|
128 | * Marks a comment as spam by blog id, post id and comment id.
|
---|
129 | * (comments.markAsSpam)
|
---|
130 | *
|
---|
131 | * @param string $blogId
|
---|
132 | * @param string $postId
|
---|
133 | * @param string $commentId
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | * @return Comment
|
---|
136 | * @throws \Google\Service\Exception
|
---|
137 | */
|
---|
138 | public function markAsSpam($blogId, $postId, $commentId, $optParams = [])
|
---|
139 | {
|
---|
140 | $params = ['blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId];
|
---|
141 | $params = array_merge($params, $optParams);
|
---|
142 | return $this->call('markAsSpam', [$params], Comment::class);
|
---|
143 | }
|
---|
144 | /**
|
---|
145 | * Removes the content of a comment by blog id, post id and comment id.
|
---|
146 | * (comments.removeContent)
|
---|
147 | *
|
---|
148 | * @param string $blogId
|
---|
149 | * @param string $postId
|
---|
150 | * @param string $commentId
|
---|
151 | * @param array $optParams Optional parameters.
|
---|
152 | * @return Comment
|
---|
153 | * @throws \Google\Service\Exception
|
---|
154 | */
|
---|
155 | public function removeContent($blogId, $postId, $commentId, $optParams = [])
|
---|
156 | {
|
---|
157 | $params = ['blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId];
|
---|
158 | $params = array_merge($params, $optParams);
|
---|
159 | return $this->call('removeContent', [$params], Comment::class);
|
---|
160 | }
|
---|
161 | }
|
---|
162 |
|
---|
163 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
164 | class_alias(Comments::class, 'Google_Service_Blogger_Resource_Comments');
|
---|