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 "conversations" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $chatService = new Google\Service\HangoutsChat(...);
27 *   $conversations = $chatService->conversations;
28 *  </code>
29 */
30class RoomsConversations extends \Google\Service\Resource
31{
32  /**
33   * Legacy path for creating message. Calling these will result in a BadRequest
34   * response. (conversations.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
59// Adding a class alias for backwards compatibility with the previous class name.
60class_alias(RoomsConversations::class, 'Google_Service_HangoutsChat_Resource_RoomsConversations');
61