| @@ 39-48 (lines=10) @@ | ||
| 36 | * |
|
| 37 | * @return Post|ResponseInterface |
|
| 38 | */ |
|
| 39 | public function patchPost(string $postId, array $params) |
|
| 40 | { |
|
| 41 | if (empty($postId)) { |
|
| 42 | throw new InvalidArgumentException('PostId can not be empty'); |
|
| 43 | } |
|
| 44 | ||
| 45 | $response = $this->httpPut(sprintf('/posts/%s/patch', $postId), $params); |
|
| 46 | ||
| 47 | return $this->handleResponse($response, Post::class); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Update a post. |
|
| @@ 60-69 (lines=10) @@ | ||
| 57 | * |
|
| 58 | * @return Post|ResponseInterface |
|
| 59 | */ |
|
| 60 | public function updatePost(string $postId, array $params) |
|
| 61 | { |
|
| 62 | if (empty($postId)) { |
|
| 63 | throw new InvalidArgumentException('PostId can not be empty'); |
|
| 64 | } |
|
| 65 | ||
| 66 | $response = $this->httpPut(sprintf('/posts/%s', $postId), $params); |
|
| 67 | ||
| 68 | return $this->handleResponse($response, Post::class); |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * Get a single post. |
|
| @@ 166-175 (lines=10) @@ | ||
| 163 | * |
|
| 164 | * @return TeamMember |
|
| 165 | */ |
|
| 166 | public function getTeamMember(string $teamId, string $userId) |
|
| 167 | { |
|
| 168 | if (empty($teamId) || empty($userId)) { |
|
| 169 | throw new InvalidArgumentException('TeamID and UserId can not be empty'); |
|
| 170 | } |
|
| 171 | ||
| 172 | $response = $this->httpGet(sprintf('/teams/%s/members/%s', $teamId, $userId)); |
|
| 173 | ||
| 174 | return $this->handleResponse($response, TeamMember::class); |
|
| 175 | } |
|
| 176 | ||
| 177 | /** |
|
| 178 | * Remove a team member. |
|