|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Created by PhpStorm. |
|
4
|
|
|
* User: Matthew |
|
5
|
|
|
* Date: 22/04/2016 |
|
6
|
|
|
* Time: 5:55 PM |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace Mpclarkson\Laravel\Freshdesk; |
|
10
|
|
|
|
|
11
|
|
|
use Freshdesk\Api as Freshdesk; |
|
12
|
|
|
|
|
13
|
|
|
class Api { |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var Freshdesk |
|
17
|
|
|
*/ |
|
18
|
|
|
private $api; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Api constructor. |
|
22
|
|
|
* @param $key |
|
23
|
|
|
* @param $domain |
|
24
|
|
|
*/ |
|
25
|
|
|
public function __construct($key, $domain) |
|
26
|
|
|
{ |
|
27
|
|
|
$this->api = new Freshdesk($key, $domain); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @return \Freshdesk\Resources\Agent |
|
32
|
|
|
*/ |
|
33
|
|
|
public function agents() |
|
34
|
|
|
{ |
|
35
|
|
|
return $this->api->agents; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @return \Freshdesk\Resources\Company |
|
40
|
|
|
*/ |
|
41
|
|
|
public function companies() |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->api->companies; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return \Freshdesk\Resources\Contact |
|
48
|
|
|
*/ |
|
49
|
|
|
public function contacts() |
|
50
|
|
|
{ |
|
51
|
|
|
return $this->api->contacts; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @return \Freshdesk\Resources\Group |
|
56
|
|
|
*/ |
|
57
|
|
|
public function groups() |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->api->groups; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @return \Freshdesk\Resources\Ticket |
|
64
|
|
|
*/ |
|
65
|
|
|
public function tickets() |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->api->tickets; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @return \Freshdesk\Resources\TimeEntry |
|
72
|
|
|
*/ |
|
73
|
|
|
public function timeEntries() |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->api->timeEntries; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @return \Freshdesk\Resources\Conversation |
|
80
|
|
|
*/ |
|
81
|
|
|
public function conversations() |
|
82
|
|
|
{ |
|
83
|
|
|
return $this->api->conversations; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return \Freshdesk\Resources\Category |
|
88
|
|
|
*/ |
|
89
|
|
|
public function categories() |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->api->categories; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @return \Freshdesk\Resources\Forum |
|
96
|
|
|
*/ |
|
97
|
|
|
public function forums() |
|
98
|
|
|
{ |
|
99
|
|
|
return $this->api->forums; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* @return \Freshdesk\Resources\Topic |
|
104
|
|
|
*/ |
|
105
|
|
|
public function topics() |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->api->topics; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* @return \Freshdesk\Resources\Comment |
|
112
|
|
|
*/ |
|
113
|
|
|
public function comments() |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->api->comments; |
|
116
|
|
|
} |
|
117
|
|
|
/** |
|
118
|
|
|
* @return \Freshdesk\Resources\EmailConfig |
|
119
|
|
|
*/ |
|
120
|
|
|
public function emailConfigs() |
|
121
|
|
|
{ |
|
122
|
|
|
return $this->api->emailConfigs; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
/** |
|
126
|
|
|
* @return \Freshdesk\Resources\Product |
|
127
|
|
|
*/ |
|
128
|
|
|
public function products() |
|
129
|
|
|
{ |
|
130
|
|
|
return $this->api->products; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
/** |
|
134
|
|
|
* @return \Freshdesk\Resources\BusinessHour |
|
135
|
|
|
*/ |
|
136
|
|
|
public function businessHours() |
|
137
|
|
|
{ |
|
138
|
|
|
return $this->api->businessHours; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* @return \Freshdesk\Resources\SLAPolicy |
|
143
|
|
|
*/ |
|
144
|
|
|
public function slaPolicies() |
|
145
|
|
|
{ |
|
146
|
|
|
return $this->api->slaPolicies; |
|
147
|
|
|
} |
|
148
|
|
|
} |
|
149
|
|
|
|