OrderRequest::createFolder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 7
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\turbotext\request;
8
9
class OrderRequest extends \carono\turbotext\RequestAbstract
10
{
11
	/**
12
	 * Возвращает все папки пользователя
13
	 *
14
	 * @return \carono\turbotext\response\FoldersResponse|string|\stdClass|\SimpleXMLElement
15
	 */
16
	public function getFolders()
17
	{
18
		$params = [
19
			'action' => 'get_folders'
20
		];
21
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\FoldersResponse');
22
	}
23
24
25
	/**
26
	 * Возвращает количество доступных средств
27
	 *
28
	 * @return \carono\turbotext\response\BalanceResponse|string|\stdClass|\SimpleXMLElement
29
	 */
30
	public function getBalance()
31
	{
32
		$params = [
33
			'action' => 'get_balance'
34
		];
35
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\BalanceResponse');
36
	}
37
38
39
	/**
40
	 * Создаёт новую папку
41
	 *
42
	 * @param string $name имя новой папки
43
	 * @return \carono\turbotext\response\CreateFolderResponse|string|\stdClass|\SimpleXMLElement
44
	 */
45
	public function createFolder($name)
46
	{
47
		$params = [
48
			'action' => 'create_folder',
49
			'name' => $name
50
		];
51
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\CreateFolderResponse');
52
	}
53
54
55
	/**
56
	 * Возвращает все заказы пользователя в папке folder_id. Если folder_id не указано, возвращает все заказы.
57
	 *
58
	 * @param string $folder_id уникальный идентификатор папки (необязательный параметр)
59
	 * @return \carono\turbotext\response\OrdersResponse|string|\stdClass|\SimpleXMLElement
60
	 */
61
	public function getOrders($folder_id)
62
	{
63
		$params = [
64
			'action' => 'get_orders',
65
			'folder_id' => $folder_id
66
		];
67
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\OrdersResponse');
68
	}
69
70
71
	/**
72
	 * Создаёт новый заказ
73
	 *
74
	 * @param \carono\turbotext\config\OrderConfig|array $config
75
	 * @return \carono\turbotext\response\CreateOrderResponse|string|\stdClass|\SimpleXMLElement
76
	 */
77
	public function createOrder($config)
78
	{
79
		$params = [
80
			'action' => 'create_order'
81
		];
82
		foreach (($config instanceof \carono\turbotext\ConfigAbstract ? $config->toArray() : $config) as $key => $value) {
83
		    $params[$key] = $value;
84
		}
85
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\CreateOrderResponse');
86
	}
87
88
89
	/**
90
	 * Создаёт новый заказ на перевод
91
	 *
92
	 * @param \carono\turbotext\config\TranslateOrderConfig|array $config
93
	 * @return \carono\turbotext\response\CreateTranslateOrderResponse|string|\stdClass|\SimpleXMLElement
94
	 */
95
	public function createTranslateOrder($config)
96
	{
97
		$params = [
98
			'action' => 'create_translate_order'
99
		];
100
		foreach (($config instanceof \carono\turbotext\ConfigAbstract ? $config->toArray() : $config) as $key => $value) {
101
		    $params[$key] = $value;
102
		}
103
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\CreateTranslateOrderResponse');
104
	}
105
106
107
	/**
108
	 * Получает информацию о заказе order_id
109
	 *
110
	 * @param int $order_id уникальный идентификатор (номер) заказа.
111
	 * @return \carono\turbotext\response\OrderResponse|string|\stdClass|\SimpleXMLElement
112
	 */
113
	public function getOrder($order_id)
114
	{
115
		$params = [
116
			'action' => 'get_order',
117
			'order_id' => $order_id
118
		];
119
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\OrderResponse');
120
	}
121
122
123
	/**
124
	 * Удаляет заказ order_id
125
	 *
126
	 * @param int $order_id уникальный идентификатор (номер) заказа.
127
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
128
	 */
129
	public function deleteOrder($order_id)
130
	{
131
		$params = [
132
			'action' => 'delete_order',
133
			'order_id' => $order_id
134
		];
135
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
136
	}
137
138
139
	/**
140
	 * Отправить заказ на доработку
141
	 *
142
	 * @param int $order_id уникальный идентификатор (номер) заказа
143
	 * @param string $text причина, по которой вы отправляете заказ на доработку
144
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
145
	 */
146
	public function rejectOrder($order_id, $text)
147
	{
148
		$params = [
149
			'action' => 'reject_order',
150
			'order_id' => $order_id,
151
			'text' => $text
152
		];
153
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
154
	}
155
156
157
	/**
158
	 * Отклонить заказ
159
	 *
160
	 * @param int $order_id уникальный идентификатор (номер) заказа
161
	 * @param string $text причина, по которой вы отказываетесь от заказа
162
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
163
	 */
164
	public function declineOrder($order_id, $text)
165
	{
166
		$params = [
167
			'action' => 'decline_order',
168
			'order_id' => $order_id,
169
			'text' => $text
170
		];
171
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
172
	}
173
174
175
	/**
176
	 * Принять заказ
177
	 *
178
	 * @param int $order_id уникальный идентификатор (номер) заказа
179
	 * @param string $text комментарий (необязательно)
180
	 * @param int $rating оценка для заказа: 5 - Отлично 4 - Неплохо 3 - Средненько 2 - Плохо 1 - Никуда не годится Параметр
181
	 * необязательный. Значение по умолчанию - 0.
182
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
183
	 */
184
	public function acceptOrder($order_id, $text, $rating)
185
	{
186
		$params = [
187
			'action' => 'accept_order',
188
			'order_id' => $order_id,
189
			'text' => $text,
190
			'rating' => $rating
191
		];
192
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
193
	}
194
195
196
	/**
197
	 * Переместить заказ в определённую папку
198
	 *
199
	 * @param int $order_id уникальный идентификатор (номер) заказа
200
	 * @param int $folder_id уникальный идентификатор папки, в которую нужно переместить заказ.
201
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
202
	 */
203
	public function moveOrder($order_id, $folder_id)
204
	{
205
		$params = [
206
			'action' => 'move_order',
207
			'order_id' => $order_id,
208
			'folder_id' => $folder_id
209
		];
210
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
211
	}
212
213
214
	/**
215
	 * Просмотереть общение по заказу
216
	 *
217
	 * @param int $order_id уникальный идентификатор (номер) заказа
218
	 * @return \carono\turbotext\response\MessagesResponse|string|\stdClass|\SimpleXMLElement
219
	 */
220
	public function getConversation($order_id)
221
	{
222
		$params = [
223
			'action' => 'getConversation',
224
			'order_id' => $order_id
225
		];
226
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\response\MessagesResponse');
227
	}
228
229
230
	/**
231
	 * Открепить заказ от просрочившего исполнителя
232
	 *
233
	 * @param int $order_id уникальный идентификатор (номер) заказа
234
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
235
	 */
236
	public function unassignAuthor($order_id)
237
	{
238
		$params = [
239
			'action' => 'unassign_author',
240
			'order_id' => $order_id
241
		];
242
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
243
	}
244
245
246
	/**
247
	 * Продлить время заказа
248
	 *
249
	 * @param int $order_id уникальный идентификатор (номер) заказа
250
	 * @param int $order_hours сколько часов добавить (от 1 до 96 включительно)
251
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
252
	 */
253
	public function extendTimeOrder($order_id, $order_hours)
254
	{
255
		$params = [
256
			'action' => 'extend_time_order',
257
			'order_id' => $order_id,
258
			'order_hours' => $order_hours
259
		];
260
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
261
	}
262
263
264
	/**
265
	 * Редактировать заказ
266
	 *
267
	 * @param \carono\turbotext\config\EditOrderConfig|array $config
268
	 * @return \carono\turbotext\Response|string|\stdClass|\SimpleXMLElement
269
	 */
270
	public function editOrder($config)
271
	{
272
		$params = [
273
			'action' => 'edit_order'
274
		];
275
		foreach (($config instanceof \carono\turbotext\ConfigAbstract ? $config->toArray() : $config) as $key => $value) {
276
		    $params[$key] = $value;
277
		}
278
		return $this->getClient()->getContent('api', $params, 'carono\turbotext\Response');
279
	}
280
}
281