MessageRequest::pmGetSent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\turbotext\request;
8
9
class MessageRequest extends \carono\turbotext\RequestAbstract
10
{
11
	/**
12
	 * Получить список пользователей, кому вы отправляли личные сообщения
13
	 *
14
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
15
	 */
16
	public function pmGetSent()
17
	{
18
		$params = [
19
			'action' => 'pm_get_sent'
20
		];
21
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
22
	}
23
24
25
	/**
26
	 * Получить список пользователей, которые вам отправляли личные сообщения
27
	 *
28
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
29
	 */
30
	public function pmGetReceived()
31
	{
32
		$params = [
33
			'action' => 'pm_get_received'
34
		];
35
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
36
	}
37
38
39
	/**
40
	 * Отправить личное сообщение
41
	 *
42
	 * @param int $user_id ID пользователя, которому нужно отправить сообщение
43
	 * @param string $message текст сообщения
44
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
45
	 */
46
	public function pmSend($user_id, $message)
47
	{
48
		$params = [
49
			'action' => 'pm_send',
50
			'user_id' => $user_id,
51
			'message' => $message
52
		];
53
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
54
	}
55
56
57
	/**
58
	 * Получить переписку с определённым пользователем
59
	 *
60
	 * @param int $user_id ID пользователя, переписку с которым нужно получить
61
	 * @return \carono\turbotext\response\MessagesResponse|string|\stdClass|\SimpleXMLElement
62
	 */
63
	public function pmGetConversation($user_id)
64
	{
65
		$params = [
66
			'action' => 'pm_get_conversation',
67
			'user_id' => $user_id
68
		];
69
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\MessagesResponse');
70
	}
71
}
72