| @@ 396-411 (lines=16) @@ | ||
| 393 | * |
|
| 394 | * @return Response The response |
|
| 395 | */ |
|
| 396 | public function followUser($username) |
|
| 397 | { |
|
| 398 | if (empty($username)) { |
|
| 399 | throw new InvalidArgumentException('Username is required.'); |
|
| 400 | } |
|
| 401 | ||
| 402 | $request = new Request( |
|
| 403 | 'POST', |
|
| 404 | 'me/following/users/', |
|
| 405 | array( |
|
| 406 | 'user' => (string) $username, |
|
| 407 | ) |
|
| 408 | ); |
|
| 409 | ||
| 410 | return $this->execute($request); |
|
| 411 | } |
|
| 412 | ||
| 413 | /** |
|
| 414 | * Unfollow a user. |
|
| @@ 422-434 (lines=13) @@ | ||
| 419 | * |
|
| 420 | * @return Response The response |
|
| 421 | */ |
|
| 422 | public function unfollowUser($usernameOrUserId) |
|
| 423 | { |
|
| 424 | if (empty($usernameOrUserId)) { |
|
| 425 | throw new InvalidArgumentException('Username or user ID is required.'); |
|
| 426 | } |
|
| 427 | ||
| 428 | $request = new Request( |
|
| 429 | 'DELETE', |
|
| 430 | "me/following/users/{$usernameOrUserId}" |
|
| 431 | ); |
|
| 432 | ||
| 433 | return $this->execute($request); |
|
| 434 | } |
|
| 435 | ||
| 436 | /** |
|
| 437 | * Follow a board. |
|
| @@ 533-542 (lines=10) @@ | ||
| 530 | * |
|
| 531 | * @return Response The response |
|
| 532 | */ |
|
| 533 | public function deleteBoard($boardId) |
|
| 534 | { |
|
| 535 | if (empty($boardId)) { |
|
| 536 | throw new InvalidArgumentException('The board id should not be empty.'); |
|
| 537 | } |
|
| 538 | ||
| 539 | $request = new Request('DELETE', "boards/{$boardId}/"); |
|
| 540 | ||
| 541 | return $this->execute($request); |
|
| 542 | } |
|
| 543 | ||
| 544 | /** |
|
| 545 | * Create a pin on a board. |
|
| @@ 597-606 (lines=10) @@ | ||
| 594 | * |
|
| 595 | * @return Response The response |
|
| 596 | */ |
|
| 597 | public function deletePin($pinId) |
|
| 598 | { |
|
| 599 | if (empty($pinId)) { |
|
| 600 | throw new InvalidArgumentException('The pin id should not be empty.'); |
|
| 601 | } |
|
| 602 | ||
| 603 | $request = new Request('DELETE', "pins/{$pinId}/"); |
|
| 604 | ||
| 605 | return $this->execute($request); |
|
| 606 | } |
|
| 607 | ||
| 608 | /** |
|
| 609 | * Get the next items for a paged list. |
|