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\HangoutsChat\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\HangoutsChat\Message;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * The "dms" collection of methods.
|
---|
24 | * Typical usage is:
|
---|
25 | * <code>
|
---|
26 | * $chatService = new Google\Service\HangoutsChat(...);
|
---|
27 | * $dms = $chatService->dms;
|
---|
28 | * </code>
|
---|
29 | */
|
---|
30 | class Dms extends \Google\Service\Resource
|
---|
31 | {
|
---|
32 | /**
|
---|
33 | * Legacy path for creating message. Calling these will result in a BadRequest
|
---|
34 | * response. (dms.messages)
|
---|
35 | *
|
---|
36 | * @param string $parent Required. The resource name of the space in which to
|
---|
37 | * create a message. Format: spaces/{space}
|
---|
38 | * @param Message $postBody
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | *
|
---|
41 | * @opt_param string messageId Optional. A custom name for a Chat message
|
---|
42 | * assigned at creation. Must start with `client-` and contain only lowercase
|
---|
43 | * letters, numbers, and hyphens up to 63 characters in length. Specify this
|
---|
44 | * field to get, update, or delete the message with the specified value. For
|
---|
45 | * example usage, see [Name a created message](https://developers.google.com/cha
|
---|
46 | * t/api/guides/crudl/messages#name_a_created_message).
|
---|
47 | * @opt_param string messageReplyOption Optional. Specifies whether a message
|
---|
48 | * starts a thread or replies to one. Only supported in named spaces.
|
---|
49 | * @opt_param string requestId Optional. A unique request ID for this message.
|
---|
50 | * Specifying an existing request ID returns the message created with that ID
|
---|
51 | * instead of creating a new message.
|
---|
52 | * @opt_param string threadKey Optional. Deprecated: Use thread.thread_key
|
---|
53 | * instead. Opaque thread identifier. To start or add to a thread, create a
|
---|
54 | * message and specify a `threadKey` or the thread.name. For example usage, see
|
---|
55 | * [Start or reply to a message
|
---|
56 | * thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread).
|
---|
57 | * @return Message
|
---|
58 | */
|
---|
59 | public function messages($parent, Message $postBody, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('messages', [$params], Message::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Legacy path for creating message. Calling these will result in a BadRequest
|
---|
67 | * response. (dms.webhooks)
|
---|
68 | *
|
---|
69 | * @param string $parent Required. The resource name of the space in which to
|
---|
70 | * create a message. Format: spaces/{space}
|
---|
71 | * @param Message $postBody
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param string messageId Optional. A custom name for a Chat message
|
---|
75 | * assigned at creation. Must start with `client-` and contain only lowercase
|
---|
76 | * letters, numbers, and hyphens up to 63 characters in length. Specify this
|
---|
77 | * field to get, update, or delete the message with the specified value. For
|
---|
78 | * example usage, see [Name a created message](https://developers.google.com/cha
|
---|
79 | * t/api/guides/crudl/messages#name_a_created_message).
|
---|
80 | * @opt_param string messageReplyOption Optional. Specifies whether a message
|
---|
81 | * starts a thread or replies to one. Only supported in named spaces.
|
---|
82 | * @opt_param string requestId Optional. A unique request ID for this message.
|
---|
83 | * Specifying an existing request ID returns the message created with that ID
|
---|
84 | * instead of creating a new message.
|
---|
85 | * @opt_param string threadKey Optional. Deprecated: Use thread.thread_key
|
---|
86 | * instead. Opaque thread identifier. To start or add to a thread, create a
|
---|
87 | * message and specify a `threadKey` or the thread.name. For example usage, see
|
---|
88 | * [Start or reply to a message
|
---|
89 | * thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread).
|
---|
90 | * @return Message
|
---|
91 | */
|
---|
92 | public function webhooks($parent, Message $postBody, $optParams = [])
|
---|
93 | {
|
---|
94 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
95 | $params = array_merge($params, $optParams);
|
---|
96 | return $this->call('webhooks', [$params], Message::class);
|
---|
97 | }
|
---|
98 | }
|
---|
99 |
|
---|
100 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
101 | class_alias(Dms::class, 'Google_Service_HangoutsChat_Resource_Dms');
|
---|