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