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\CloudSupport\Resource;
19
20use Google\Service\CloudSupport\Comment;
21use Google\Service\CloudSupport\ListCommentsResponse;
22
23/**
24 * The "comments" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $cloudsupportService = new Google\Service\CloudSupport(...);
28 *   $comments = $cloudsupportService->comments;
29 *  </code>
30 */
31class CasesComments extends \Google\Service\Resource
32{
33  /**
34   * Add a new comment to the specified Case. (comments.create)
35   *
36   * @param string $parent Required. The resource name of Case to which this
37   * comment should be added.
38   * @param Comment $postBody
39   * @param array $optParams Optional parameters.
40   * @return Comment
41   */
42  public function create($parent, Comment $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], Comment::class);
47  }
48  /**
49   * Retrieve all Comments associated with the Case object.
50   * (comments.listCasesComments)
51   *
52   * @param string $parent Required. The resource name of Case object for which
53   * comments should be listed.
54   * @param array $optParams Optional parameters.
55   *
56   * @opt_param int pageSize The maximum number of comments fetched with each
57   * request. Defaults to 10.
58   * @opt_param string pageToken A token identifying the page of results to
59   * return. If unspecified, the first page is retrieved.
60   * @return ListCommentsResponse
61   */
62  public function listCasesComments($parent, $optParams = [])
63  {
64    $params = ['parent' => $parent];
65    $params = array_merge($params, $optParams);
66    return $this->call('list', [$params], ListCommentsResponse::class);
67  }
68}
69
70// Adding a class alias for backwards compatibility with the previous class name.
71class_alias(CasesComments::class, 'Google_Service_CloudSupport_Resource_CasesComments');
72