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\HangoutsChat\Resource;
19
20use Google\Service\HangoutsChat\Message;
21
22/**
23 * The "rooms" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $chatService = new Google\Service\HangoutsChat(...);
27 *   $rooms = $chatService->rooms;
28 *  </code>
29 */
30class Rooms extends \Google\Service\Resource
31{
32  /**
33   * Legacy path for creating message. Calling these will result in a BadRequest
34   * response. (rooms.messages)
35   *
36   * @param string $parent Required. Space resource name, in the form "spaces".
37   * Example: spaces/AAAAAAAAAAA
38   * @param Message $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string requestId Optional. A unique request ID for this message.
42   * Specifying an existing request ID returns the message created with that ID
43   * instead of creating a new message.
44   * @opt_param string threadKey Optional. Opaque thread identifier. To start or
45   * add to a thread, create a message and specify a `threadKey` instead of
46   * thread.name. (Setting thread.name has no effect.) The first message with a
47   * given `threadKey` starts a new thread. Subsequent messages with the same
48   * `threadKey` post into the same thread.
49   * @return Message
50   */
51  public function messages($parent, Message $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('messages', [$params], Message::class);
56  }
57  /**
58   * Legacy path for creating message. Calling these will result in a BadRequest
59   * response. (rooms.webhooks)
60   *
61   * @param string $parent Required. Space resource name, in the form "spaces".
62   * Example: spaces/AAAAAAAAAAA
63   * @param Message $postBody
64   * @param array $optParams Optional parameters.
65   *
66   * @opt_param string requestId Optional. A unique request ID for this message.
67   * Specifying an existing request ID returns the message created with that ID
68   * instead of creating a new message.
69   * @opt_param string threadKey Optional. Opaque thread identifier. To start or
70   * add to a thread, create a message and specify a `threadKey` instead of
71   * thread.name. (Setting thread.name has no effect.) The first message with a
72   * given `threadKey` starts a new thread. Subsequent messages with the same
73   * `threadKey` post into the same thread.
74   * @return Message
75   */
76  public function webhooks($parent, Message $postBody, $optParams = [])
77  {
78    $params = ['parent' => $parent, 'postBody' => $postBody];
79    $params = array_merge($params, $optParams);
80    return $this->call('webhooks', [$params], Message::class);
81  }
82}
83
84// Adding a class alias for backwards compatibility with the previous class name.
85class_alias(Rooms::class, 'Google_Service_HangoutsChat_Resource_Rooms');
86