optedIn = $optedIn; $this->key = $key; $this->host = $host; } /** * @param ?string $key * * @return self */ public function setKey($key) { $this->key = $key; return $this; } /** * @param ?string $host * * @return self */ public function setHost($host) { $this->host = $host; return $this; } /** * @param ?string $id * * @return self */ public function setId($id) { $this->id = $id; return $this; } /** * @param bool $state * * @return self */ public function setState($state) { $this->state = $state; return $this; } /** * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { $result = [ 'state' => $this->state, 'optedIn' => $this->optedIn, ]; if ($this->key !== null && $this->key !== '') { $result['key'] = $this->key; } if ($this->host !== null && $this->host !== '') { $result['host'] = $this->host; } if ($this->id !== null && $this->id !== '') { $result['id'] = $this->id; } return $result; } }