コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
 /**
  * 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);
     }
 }
コード例 #5
0
 /**
  * StatusUpdatesMessage constructor.
  *
  * @param InstanceStatusCollection $collection
  */
 public function __construct(InstanceStatusCollection $collection)
 {
     parent::__construct(self::TYPE_STATUS_UPDATES, $collection);
 }
コード例 #6
0
 /**
  * @inheritdoc
  */
 public function __construct()
 {
     parent::__construct(self::TYPE_INSTANCES_REQUEST, null);
 }
コード例 #7
0
 /**
  * AuthenticationResponse constructor.
  *
  * @param string $status
  */
 public function __construct($status)
 {
     parent::__construct(AbstractMessage::TYPE_AUTHENTICATION_RESPONSE, $status);
 }
コード例 #8
0
 /**
  * UsersResponse constructor.
  *
  * @param User[] $users
  */
 public function __construct(array $users)
 {
     parent::__construct(self::TYPE_USERS_RESPONSE, $users);
 }
コード例 #9
0
 /**
  * InstancesResponse constructor.
  *
  * @param Instance[] $instances
  */
 public function __construct(array $instances)
 {
     parent::__construct(self::TYPE_INSTANCES_RESPONSE, $instances);
 }