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\YouTube\Resource; 19 20use Google\Service\YouTube\LiveChatMessage; 21use Google\Service\YouTube\LiveChatMessageListResponse; 22 23/** 24 * The "liveChatMessages" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $youtubeService = new Google\Service\YouTube(...); 28 * $liveChatMessages = $youtubeService->liveChatMessages; 29 * </code> 30 */ 31class LiveChatMessages extends \Google\Service\Resource 32{ 33 /** 34 * Deletes a chat message. (liveChatMessages.delete) 35 * 36 * @param string $id 37 * @param array $optParams Optional parameters. 38 */ 39 public function delete($id, $optParams = []) 40 { 41 $params = ['id' => $id]; 42 $params = array_merge($params, $optParams); 43 return $this->call('delete', [$params]); 44 } 45 /** 46 * Inserts a new resource into this collection. (liveChatMessages.insert) 47 * 48 * @param string|array $part The *part* parameter serves two purposes. It 49 * identifies the properties that the write operation will set as well as the 50 * properties that the API response will include. Set the parameter value to 51 * snippet. 52 * @param LiveChatMessage $postBody 53 * @param array $optParams Optional parameters. 54 * @return LiveChatMessage 55 */ 56 public function insert($part, LiveChatMessage $postBody, $optParams = []) 57 { 58 $params = ['part' => $part, 'postBody' => $postBody]; 59 $params = array_merge($params, $optParams); 60 return $this->call('insert', [$params], LiveChatMessage::class); 61 } 62 /** 63 * Retrieves a list of resources, possibly filtered. 64 * (liveChatMessages.listLiveChatMessages) 65 * 66 * @param string $liveChatId The id of the live chat for which comments should 67 * be returned. 68 * @param string|array $part The *part* parameter specifies the liveChatComment 69 * resource parts that the API response will include. Supported values are id 70 * and snippet. 71 * @param array $optParams Optional parameters. 72 * 73 * @opt_param string hl Specifies the localization language in which the system 74 * messages should be returned. 75 * @opt_param string maxResults The *maxResults* parameter specifies the maximum 76 * number of items that should be returned in the result set. 77 * @opt_param string pageToken The *pageToken* parameter identifies a specific 78 * page in the result set that should be returned. In an API response, the 79 * nextPageToken property identify other pages that could be retrieved. 80 * @opt_param string profileImageSize Specifies the size of the profile image 81 * that should be returned for each user. 82 * @return LiveChatMessageListResponse 83 */ 84 public function listLiveChatMessages($liveChatId, $part, $optParams = []) 85 { 86 $params = ['liveChatId' => $liveChatId, 'part' => $part]; 87 $params = array_merge($params, $optParams); 88 return $this->call('list', [$params], LiveChatMessageListResponse::class); 89 } 90} 91 92// Adding a class alias for backwards compatibility with the previous class name. 93class_alias(LiveChatMessages::class, 'Google_Service_YouTube_Resource_LiveChatMessages'); 94