forked from vmkteam/rpcgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRpcClient.php
More file actions
125 lines (111 loc) · 2.67 KB
/
RpcClient.php
File metadata and controls
125 lines (111 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/** Code generated from jsonrpc schema by rpcgen v2.5.x with php v1.0.0; DO NOT EDIT. */
namespace JsonRpcClient;
use EazyJsonRpc\BaseJsonRpcClient;
use EazyJsonRpc\BaseJsonRpcException;
use GuzzleHttp\Exception\GuzzleException;
use JsonMapper_Exception;
/** Campaign **/
class Campaign {
/**
* @var Group[]
*/
public $groups;
/**
* @var int
*/
public $id;
}
/** Group **/
class Group {
/**
* @var Group|null
*/
public $child;
/**
* @var Group[]
*/
public $groups;
/**
* @var int
*/
public $id;
/**
* @var Group[]
*/
public $nodes;
/**
* @var SubGroup
*/
public $sub;
/**
* @var string
*/
public $title;
}
/** SubGroup **/
class SubGroup {
/**
* @var int
*/
public $id;
/**
* @var Group[]
*/
public $nodes;
/**
* @var string
*/
public $title;
}
/**
* RpcClient
*/
class RpcClient extends BaseJsonRpcClient {
/**
* <catalogue.First> RPC method
*
* @param Group[] $groups
* @param bool $isNotification [optional] set to true if call is notification
* @return bool
* @throws BaseJsonRpcException
* @throws GuzzleException
* @throws JsonMapper_Exception
**/
public function catalogue_First( array $groups, $isNotification = false ): bool {
return $this->call( __FUNCTION__, 'bool', [ 'groups' => $groups, ], $this->getRequestId( $isNotification ) );
}
/**
* <catalogue.Second> RPC method
*
* @param Campaign[] $campaigns
* @param bool $isNotification [optional] set to true if call is notification
* @return bool
* @throws BaseJsonRpcException
* @throws GuzzleException
* @throws JsonMapper_Exception
**/
public function catalogue_Second( array $campaigns, $isNotification = false ): bool {
return $this->call( __FUNCTION__, 'bool', [ 'campaigns' => $campaigns, ], $this->getRequestId( $isNotification ) );
}
/**
* <catalogue.Third> RPC method
*
* @param bool $isNotification [optional] set to true if call is notification
* @return Campaign
* @throws BaseJsonRpcException
* @throws GuzzleException
* @throws JsonMapper_Exception
**/
public function catalogue_Third( $isNotification = false ): Campaign {
return $this->call( __FUNCTION__, __NAMESPACE__ . '\\'. 'Campaign', [ ], $this->getRequestId( $isNotification ) );
}
/**
* Get Instance
* @param $url string RPC server url
* @return RpcClient
*/
public static function GetInstance( $url ): RpcClient {
return new self( $url );
}
}