/** * StatisticsResponse constructor. * * @param string $type * @param StatisticsRequest $request * @param mixed $response */ public function __construct($type, $request, $response) { $payload = new \stdClass(); $payload->request = $request; $payload->response = $response; parent::__construct($type, $payload); }
/** * AuthenticationRequest constructor. * * @param string $accessToken */ public function __construct($accessToken) { if (!is_string($accessToken)) { throw new MalformedRequestException('Malformed access token'); } parent::__construct(self::TYPE_AUTHENTICATION_REQUEST, $accessToken); }
/** * UsersRequest constructor. * * @param string $instanceName * * @throws MalformedRequestException */ public function __construct($instanceName) { if (!is_string($instanceName)) { throw new MalformedRequestException('Missing required parameter "instanceName"'); } parent::__construct(self::TYPE_USERS_REQUEST, $instanceName); }
/** * StatisticsRequest constructor. * * @param string $type * @param \stdClass $parameters * * @throws MalformedRequestException */ public function __construct($type, $parameters) { parent::__construct($type, $parameters); /* @var \stdClass $parameters */ if (!isset($parameters->instanceName) || empty($parameters->instanceName)) { throw new MalformedRequestException('Missing mandatory "instanceName" parameter'); } $this->_instanceName = $parameters->instanceName; if (isset($parameters->timeFrame)) { $this->_timeFrame = new TimeFrame($parameters->timeFrame); } else { $this->_timeFrame = new TimeFrame(TimeFrame::TIME_FRAME_ALL_TIME); } }
/** * StatusUpdatesMessage constructor. * * @param InstanceStatusCollection $collection */ public function __construct(InstanceStatusCollection $collection) { parent::__construct(self::TYPE_STATUS_UPDATES, $collection); }
/** * @inheritdoc */ public function __construct() { parent::__construct(self::TYPE_INSTANCES_REQUEST, null); }
/** * AuthenticationResponse constructor. * * @param string $status */ public function __construct($status) { parent::__construct(AbstractMessage::TYPE_AUTHENTICATION_RESPONSE, $status); }
/** * UsersResponse constructor. * * @param User[] $users */ public function __construct(array $users) { parent::__construct(self::TYPE_USERS_RESPONSE, $users); }
/** * InstancesResponse constructor. * * @param Instance[] $instances */ public function __construct(array $instances) { parent::__construct(self::TYPE_INSTANCES_RESPONSE, $instances); }