| 1 | <?php |
||
| 7 | class ProfileRequest extends AbstractRequest |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var mixed |
||
| 12 | */ |
||
| 13 | protected $profileSettings; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * ProfileRequest constructor. |
||
| 17 | * |
||
| 18 | * @param string $pageToken |
||
| 19 | * @param mixed $profileSettings |
||
| 20 | */ |
||
| 21 | 2 | public function __construct(string $pageToken, $profileSettings) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @return null|array |
||
| 30 | */ |
||
| 31 | 2 | protected function buildHeaders() |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @return null|array|\Kerox\Messenger\Model\ProfileSettings |
||
| 42 | */ |
||
| 43 | 2 | protected function buildBody() |
|
| 44 | { |
||
| 45 | 2 | $body = null; |
|
| 46 | 2 | if ($this->profileSettings instanceof ProfileSettings) { |
|
| 47 | 1 | $body = $this->profileSettings; |
|
| 48 | 1 | } elseif (is_array($this->profileSettings)) { |
|
| 49 | $body = [ |
||
| 50 | 'fields' => $this->profileSettings, |
||
| 51 | ]; |
||
| 52 | } |
||
| 53 | |||
| 54 | 2 | return $body; |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | 2 | protected function buildQuery(): array |
|
| 72 | } |
||
| 73 |