createAsync($body); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new TrustedApplication(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', [])); } /** * Sends a TrustedApplication create request. * * @param TrustedApplication $body * @return DomainrobotPromise */ public function createAsync(TrustedApplication $body) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/trustedapp", 'POST', ["json" => $body->toArray()] ); } /** * Sends a TrustedApplication list request. * * The following keys can be used for filtering, ordering or fetching additional * data via query parameter: * * * created * * comment * * uuid * * device * * updated * * application * * @return TrustedApplication[] */ public function list(?Query $query = null) { $domainrobotPromise = $this->listAsync($query); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); $data = $domainrobotResult->getResult()['data']; $trustedApps = array(); foreach ($data as $d) { $t = new TrustedApplication($d); array_push($trustedApps, $t); } return $trustedApps; } /** * Sends a TrustedApplication list request. * * The following keys can be used for filtering, ordering or fetching additional * data via query parameter: * * * created * * comment * * uuid * * device * * updated * * application * * @return DomainrobotPromise */ public function listAsync(?Query $query = null) { $body = null; if ($query != null) { $body = $query->toArray(true); } return new DomainrobotPromise($this->sendRequest( $this->domainrobotConfig->getUrl() . "/trustedapp/_search", 'POST', ["json" => $body] )); } /** * Sends a TrustedApplication info request. * * @param int $id * @return TrustedApplication */ public function info($id) { $domainrobotPromise = $this->infoAsync($id); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new TrustedApplication(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', [])); } /** * Sends a TrustedApplication info request. * * @param int $id * @return DomainrobotPromise */ public function infoAsync($id) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/trustedapp/$id", 'GET' ); } /** * Sends a TrustedApplication delete request. * * @param int $id * @return JsonNoData */ public function delete($id) { $domainrobotPromise = $this->deleteAsync($id); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new JsonNoData(); } /** * Sends a TrustedApplication delete request. * * @param int $id * @return DomainrobotPromise */ public function deleteAsync($id) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/trustedapp/$id", 'DELETE' ); } /** * Sends a TrustedApplication update request. * * @param TrustedApplication $body * @return void */ public function update(TrustedApplication $body) { $domainrobotPromise = $this->updateAsync($body); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); } /** * Sends a TrustedApplication update request. * * @param TrustedApplication $body * @return DomainrobotPromise */ public function updateAsync(TrustedApplication $body) { if ($body->getUuId() === null) { throw new \InvalidArgumentException("Field TrustedApplication.id is missing."); } return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/trustedapp/".$body->getUuId(), 'PUT', ["json" => $body->toArray()] ); } }__halt_compiler();----SIGNATURE:----N1/bAgOdfHaPVz6qrOnXO0JjdLe7lqfmYhRBt7kb4ucxvqAtPUfJEBFg74QxWRAjLeUtHiMMB4aO2dAsRooqzo54DtMXf8LFkxM+JcAAZ1/S7+iAXtI5UZ/jsWS879cZUn3PKNWhhNVS5NWJw0SqaWS3f22vzTUwpLw0zNle08FyhBZ8vRg1BrDFxYAkshZzKZwHJ6iJfXHMeSzdhRIb5vt/F35Y/ZJsXS9K9a7ykYIEQyZ1nvASBn+GsyxxCvTbZmRpEPMW3aeZfI2uBuN81+z8RnNfdNuM83BAqxlqN2H6xgk3Jhq3Wfakd1LH0Zafn1L7WTMd9s1qpZ4GJ3qsKhMPNynusI0aJ0UYFQPFB0feVf2k8Uc1JyAYKZ1KP7qep9kel3e8hplhV1UnuakpHokGsTcHX9NGKoG+0xfmt55AxUi6FNQJHclVezPRlsRTdITigkUz/VFsTfAzaQFme+0bxD3/3r1PS5LPtc/cEPbRg2jZ83ZXcM6Tr/BlpRexEAQs/pOeR3XsDkV9cY7OKqmyywyfGovxS7j+s9OJy5tC5jo2n49QQLgkHtRdv539dom1ha9IMkwMqM5enIz8qpxbQA3hFe/1AujVKJxn/wsYwiofbKxet2vEYMgvSw5HIblh2/HoTBnR6qEaMXAOLoj4CtciKyXsUA2YoMwCDj8=----ATTACHMENT:----ODIzODI0MTA4MjQyMDg1NyA1ODAzMDkwNjA4MjcwODIxIDc2NzY2NzA1OTcxMDcwMzA=