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;
19
20use Google\Client;
21
22/**
23 * Service definition for HangoutsChat (v1).
24 *
25 * <p>
26 * Enables apps to fetch information and perform actions in Google Chat.
27 * Authentication using a service account is a prerequisite for using the Google
28 * Chat REST API.</p>
29 *
30 * <p>
31 * For more information about this service, see the API
32 * <a href="https://developers.google.com/hangouts/chat" target="_blank">Documentation</a>
33 * </p>
34 *
35 * @author Google, Inc.
36 */
37class HangoutsChat extends \Google\Service
38{
39
40
41  public $dms;
42  public $dms_conversations;
43  public $media;
44  public $rooms;
45  public $rooms_conversations;
46  public $spaces;
47  public $spaces_members;
48  public $spaces_messages;
49  public $spaces_messages_attachments;
50
51  /**
52   * Constructs the internal representation of the HangoutsChat service.
53   *
54   * @param Client|array $clientOrConfig The client used to deliver requests, or a
55   *                                     config array to pass to a new Client instance.
56   * @param string $rootUrl The root URL used for requests to the service.
57   */
58  public function __construct($clientOrConfig = [], $rootUrl = null)
59  {
60    parent::__construct($clientOrConfig);
61    $this->rootUrl = $rootUrl ?: 'https://chat.googleapis.com/';
62    $this->servicePath = '';
63    $this->batchPath = 'batch';
64    $this->version = 'v1';
65    $this->serviceName = 'chat';
66
67    $this->dms = new HangoutsChat\Resource\Dms(
68        $this,
69        $this->serviceName,
70        'dms',
71        [
72          'methods' => [
73            'messages' => [
74              'path' => 'v1/{+parent}/messages',
75              'httpMethod' => 'POST',
76              'parameters' => [
77                'parent' => [
78                  'location' => 'path',
79                  'type' => 'string',
80                  'required' => true,
81                ],
82                'requestId' => [
83                  'location' => 'query',
84                  'type' => 'string',
85                ],
86                'threadKey' => [
87                  'location' => 'query',
88                  'type' => 'string',
89                ],
90              ],
91            ],'webhooks' => [
92              'path' => 'v1/{+parent}/webhooks',
93              'httpMethod' => 'POST',
94              'parameters' => [
95                'parent' => [
96                  'location' => 'path',
97                  'type' => 'string',
98                  'required' => true,
99                ],
100                'requestId' => [
101                  'location' => 'query',
102                  'type' => 'string',
103                ],
104                'threadKey' => [
105                  'location' => 'query',
106                  'type' => 'string',
107                ],
108              ],
109            ],
110          ]
111        ]
112    );
113    $this->dms_conversations = new HangoutsChat\Resource\DmsConversations(
114        $this,
115        $this->serviceName,
116        'conversations',
117        [
118          'methods' => [
119            'messages' => [
120              'path' => 'v1/{+parent}/messages',
121              'httpMethod' => 'POST',
122              'parameters' => [
123                'parent' => [
124                  'location' => 'path',
125                  'type' => 'string',
126                  'required' => true,
127                ],
128                'requestId' => [
129                  'location' => 'query',
130                  'type' => 'string',
131                ],
132                'threadKey' => [
133                  'location' => 'query',
134                  'type' => 'string',
135                ],
136              ],
137            ],
138          ]
139        ]
140    );
141    $this->media = new HangoutsChat\Resource\Media(
142        $this,
143        $this->serviceName,
144        'media',
145        [
146          'methods' => [
147            'download' => [
148              'path' => 'v1/media/{+resourceName}',
149              'httpMethod' => 'GET',
150              'parameters' => [
151                'resourceName' => [
152                  'location' => 'path',
153                  'type' => 'string',
154                  'required' => true,
155                ],
156              ],
157            ],
158          ]
159        ]
160    );
161    $this->rooms = new HangoutsChat\Resource\Rooms(
162        $this,
163        $this->serviceName,
164        'rooms',
165        [
166          'methods' => [
167            'messages' => [
168              'path' => 'v1/{+parent}/messages',
169              'httpMethod' => 'POST',
170              'parameters' => [
171                'parent' => [
172                  'location' => 'path',
173                  'type' => 'string',
174                  'required' => true,
175                ],
176                'requestId' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180                'threadKey' => [
181                  'location' => 'query',
182                  'type' => 'string',
183                ],
184              ],
185            ],'webhooks' => [
186              'path' => 'v1/{+parent}/webhooks',
187              'httpMethod' => 'POST',
188              'parameters' => [
189                'parent' => [
190                  'location' => 'path',
191                  'type' => 'string',
192                  'required' => true,
193                ],
194                'requestId' => [
195                  'location' => 'query',
196                  'type' => 'string',
197                ],
198                'threadKey' => [
199                  'location' => 'query',
200                  'type' => 'string',
201                ],
202              ],
203            ],
204          ]
205        ]
206    );
207    $this->rooms_conversations = new HangoutsChat\Resource\RoomsConversations(
208        $this,
209        $this->serviceName,
210        'conversations',
211        [
212          'methods' => [
213            'messages' => [
214              'path' => 'v1/{+parent}/messages',
215              'httpMethod' => 'POST',
216              'parameters' => [
217                'parent' => [
218                  'location' => 'path',
219                  'type' => 'string',
220                  'required' => true,
221                ],
222                'requestId' => [
223                  'location' => 'query',
224                  'type' => 'string',
225                ],
226                'threadKey' => [
227                  'location' => 'query',
228                  'type' => 'string',
229                ],
230              ],
231            ],
232          ]
233        ]
234    );
235    $this->spaces = new HangoutsChat\Resource\Spaces(
236        $this,
237        $this->serviceName,
238        'spaces',
239        [
240          'methods' => [
241            'get' => [
242              'path' => 'v1/{+name}',
243              'httpMethod' => 'GET',
244              'parameters' => [
245                'name' => [
246                  'location' => 'path',
247                  'type' => 'string',
248                  'required' => true,
249                ],
250              ],
251            ],'list' => [
252              'path' => 'v1/spaces',
253              'httpMethod' => 'GET',
254              'parameters' => [
255                'pageSize' => [
256                  'location' => 'query',
257                  'type' => 'integer',
258                ],
259                'pageToken' => [
260                  'location' => 'query',
261                  'type' => 'string',
262                ],
263              ],
264            ],'webhooks' => [
265              'path' => 'v1/{+parent}/webhooks',
266              'httpMethod' => 'POST',
267              'parameters' => [
268                'parent' => [
269                  'location' => 'path',
270                  'type' => 'string',
271                  'required' => true,
272                ],
273                'requestId' => [
274                  'location' => 'query',
275                  'type' => 'string',
276                ],
277                'threadKey' => [
278                  'location' => 'query',
279                  'type' => 'string',
280                ],
281              ],
282            ],
283          ]
284        ]
285    );
286    $this->spaces_members = new HangoutsChat\Resource\SpacesMembers(
287        $this,
288        $this->serviceName,
289        'members',
290        [
291          'methods' => [
292            'get' => [
293              'path' => 'v1/{+name}',
294              'httpMethod' => 'GET',
295              'parameters' => [
296                'name' => [
297                  'location' => 'path',
298                  'type' => 'string',
299                  'required' => true,
300                ],
301              ],
302            ],'list' => [
303              'path' => 'v1/{+parent}/members',
304              'httpMethod' => 'GET',
305              'parameters' => [
306                'parent' => [
307                  'location' => 'path',
308                  'type' => 'string',
309                  'required' => true,
310                ],
311                'pageSize' => [
312                  'location' => 'query',
313                  'type' => 'integer',
314                ],
315                'pageToken' => [
316                  'location' => 'query',
317                  'type' => 'string',
318                ],
319              ],
320            ],
321          ]
322        ]
323    );
324    $this->spaces_messages = new HangoutsChat\Resource\SpacesMessages(
325        $this,
326        $this->serviceName,
327        'messages',
328        [
329          'methods' => [
330            'create' => [
331              'path' => 'v1/{+parent}/messages',
332              'httpMethod' => 'POST',
333              'parameters' => [
334                'parent' => [
335                  'location' => 'path',
336                  'type' => 'string',
337                  'required' => true,
338                ],
339                'requestId' => [
340                  'location' => 'query',
341                  'type' => 'string',
342                ],
343                'threadKey' => [
344                  'location' => 'query',
345                  'type' => 'string',
346                ],
347              ],
348            ],'delete' => [
349              'path' => 'v1/{+name}',
350              'httpMethod' => 'DELETE',
351              'parameters' => [
352                'name' => [
353                  'location' => 'path',
354                  'type' => 'string',
355                  'required' => true,
356                ],
357              ],
358            ],'get' => [
359              'path' => 'v1/{+name}',
360              'httpMethod' => 'GET',
361              'parameters' => [
362                'name' => [
363                  'location' => 'path',
364                  'type' => 'string',
365                  'required' => true,
366                ],
367              ],
368            ],'update' => [
369              'path' => 'v1/{+name}',
370              'httpMethod' => 'PUT',
371              'parameters' => [
372                'name' => [
373                  'location' => 'path',
374                  'type' => 'string',
375                  'required' => true,
376                ],
377                'updateMask' => [
378                  'location' => 'query',
379                  'type' => 'string',
380                ],
381              ],
382            ],
383          ]
384        ]
385    );
386    $this->spaces_messages_attachments = new HangoutsChat\Resource\SpacesMessagesAttachments(
387        $this,
388        $this->serviceName,
389        'attachments',
390        [
391          'methods' => [
392            'get' => [
393              'path' => 'v1/{+name}',
394              'httpMethod' => 'GET',
395              'parameters' => [
396                'name' => [
397                  'location' => 'path',
398                  'type' => 'string',
399                  'required' => true,
400                ],
401              ],
402            ],
403          ]
404        ]
405    );
406  }
407}
408
409// Adding a class alias for backwards compatibility with the previous class name.
410class_alias(HangoutsChat::class, 'Google_Service_HangoutsChat');
411