@@ -41,12 +41,50 @@ public function getAllTeams()
41
41
}
42
42
43
43
/**
44
- * @param $team_id
45
44
* @return \Psr\Http\Message\ResponseInterface
46
45
*/
47
- public function getGetTeamMembers ($ team_id )
46
+ public function getAllTeamsUserIsMemberOf ()
47
+ {
48
+ return $ this ->client ->get (self ::$ endpoint . '/members ' );
49
+ }
50
+
51
+ /**
52
+ * @return \Psr\Http\Message\ResponseInterface
53
+ */
54
+ public function getCountUnreadMessagesAndMentionsInTeamsUserIsMemberOf ()
55
+ {
56
+ return $ this ->client ->get (self ::$ endpoint . '/unread ' );
57
+ }
58
+
59
+ /**
60
+ * @param $team_id
61
+ * @param $offset
62
+ * @param $limit
63
+ * @return null|\Psr\Http\Message\ResponseInterface
64
+ */
65
+ public function getTeamMembers ($ team_id , $ offset , $ limit )
66
+ {
67
+ return $ this ->client ->get (self ::$ endpoint . '/ ' . $ team_id . '/members/ ' . $ offset . '/ ' . $ limit );
68
+ }
69
+
70
+ /**
71
+ * @param $team_id
72
+ * @param $userId
73
+ * @return null|\Psr\Http\Message\ResponseInterface
74
+ */
75
+ public function getSingleTeamMember ($ team_id , $ userId )
76
+ {
77
+ return $ this ->client ->get (self ::$ endpoint . '/ ' . $ team_id . '/members/ ' . $ userId );
78
+ }
79
+
80
+ /**
81
+ * @param $team_id
82
+ * @param array $requestOptions
83
+ * @return null|\Psr\Http\Message\ResponseInterface
84
+ */
85
+ public function getTeamMembersByIds ($ team_id , array $ requestOptions )
48
86
{
49
- return $ this ->client ->get (self ::$ endpoint . '/members/ ' . $ team_id );
87
+ return $ this ->client ->post (self ::$ endpoint . '/ ' . $ team_id . ' /members/ids ' , $ requestOptions );
50
88
}
51
89
52
90
/**
@@ -58,33 +96,60 @@ public function getTeam($team_id)
58
96
return $ this ->client ->get (self ::$ endpoint . '/ ' . $ team_id . '/me ' );
59
97
}
60
98
99
+ /**
100
+ * @param $teamName
101
+ * @return \Psr\Http\Message\ResponseInterface
102
+ */
103
+ public function getTeamByName ($ teamName )
104
+ {
105
+ return $ this ->client ->get (self ::$ endpoint . '/name/ ' . $ teamName );
106
+ }
107
+
61
108
/**
62
109
* @param $team_id
63
110
* @param array $requestOptions
64
111
* @return \Psr\Http\Message\ResponseInterface
65
112
*/
66
113
public function updateTeam ($ team_id , array $ requestOptions )
67
114
{
68
- return $ this ->client ->post (self ::$ endpoint . '/teams/ ' . $ team_id . '/update ' , $ requestOptions );
115
+ return $ this ->client ->post (self ::$ endpoint . '/ ' . $ team_id . '/update ' , $ requestOptions );
69
116
}
70
117
71
118
/**
72
- * @param $team_id
73
- * @param $user_id
119
+ * @param $team_id
74
120
* @return \Psr\Http\Message\ResponseInterface
75
121
*/
76
- public function addUser ($ team_id, $ user_id )
122
+ public function getStatsOfTeam ($ team_id )
77
123
{
78
- return $ this ->client ->post (self ::$ endpoint . '/teams/ ' . $ team_id . '/add_user_to_team ' , compact ( ' user_id ' ) );
124
+ return $ this ->client ->get (self ::$ endpoint . '/ ' . $ team_id . '/stats ' );
79
125
}
80
126
81
127
/**
82
128
* @param $team_id
83
- * @param $user_id
129
+ * @param array $requestOptions
84
130
* @return \Psr\Http\Message\ResponseInterface
85
131
*/
86
- public function removeUser ($ team_id , $ user_id )
132
+ public function addUser ($ team_id , array $ requestOptions )
133
+ {
134
+ return $ this ->client ->post (self ::$ endpoint . '/ ' . $ team_id . '/add_user_to_team ' , $ requestOptions );
135
+ }
136
+
137
+ /**
138
+ * @param $team_id
139
+ * @param array $requestOptions
140
+ * @return null|\Psr\Http\Message\ResponseInterface
141
+ */
142
+ public function removeUser ($ team_id , array $ requestOptions )
143
+ {
144
+ return $ this ->client ->post (self ::$ endpoint . '/ ' . $ team_id . '/remove_user_from_team ' , $ requestOptions );
145
+ }
146
+
147
+ /**
148
+ * @param $team_id
149
+ * @return null|\Psr\Http\Message\ResponseInterface
150
+ */
151
+ public function getAllSlashCommandsOfTeam ($ team_id )
87
152
{
88
- return $ this ->client ->post (self ::$ endpoint . '/teams/ ' . $ team_id . '/remove_user_from_team ' , compact ( ' user_id ' ) );
153
+ return $ this ->client ->get (self ::$ endpoint . '/ ' . $ team_id . '/commands/list_team_commands ' );
89
154
}
90
155
}
0 commit comments