| Requires any of the roles: | Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator |
| GET,POST,PUT,DELETE,OPTIONS | /v1/EventAgentData/{EventRegistrationId} |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class EventAgentData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $EventAgentDataId=0,
/** @var int */
public int $EventAgentRegistrationId=0,
/** @var int */
public int $EventFieldId=0,
/** @var string|null */
public ?string $Value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['EventAgentDataId'])) $this->EventAgentDataId = $o['EventAgentDataId'];
if (isset($o['EventAgentRegistrationId'])) $this->EventAgentRegistrationId = $o['EventAgentRegistrationId'];
if (isset($o['EventFieldId'])) $this->EventFieldId = $o['EventFieldId'];
if (isset($o['Value'])) $this->Value = $o['Value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->EventAgentDataId)) $o['EventAgentDataId'] = $this->EventAgentDataId;
if (isset($this->EventAgentRegistrationId)) $o['EventAgentRegistrationId'] = $this->EventAgentRegistrationId;
if (isset($this->EventFieldId)) $o['EventFieldId'] = $this->EventFieldId;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
class EventAgentDataResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<EventAgentData>|null */
public ?array $EventAgentData=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['EventAgentData'])) $this->EventAgentData = JsonConverters::fromArray('EventAgentData', $o['EventAgentData']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->EventAgentData)) $o['EventAgentData'] = JsonConverters::toArray('EventAgentData', $this->EventAgentData);
return empty($o) ? new class(){} : $o;
}
}
class EventAgentDataRequest implements JsonSerializable
{
public function __construct(
/** @var array<EventAgentData>|null */
public ?array $EventAgentData=null,
/** @var string */
public string $EventRegistrationId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['EventAgentData'])) $this->EventAgentData = JsonConverters::fromArray('EventAgentData', $o['EventAgentData']);
if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->EventAgentData)) $o['EventAgentData'] = JsonConverters::toArray('EventAgentData', $this->EventAgentData);
if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
return empty($o) ? new class(){} : $o;
}
}
PHP EventAgentDataRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/EventAgentData/{EventRegistrationId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
EventAgentData:
[
{
EventAgentDataId: 0,
EventAgentRegistrationId: 0,
EventFieldId: 0,
Value: String
}
],
EventRegistrationId: 00000000000000000000000000000000
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
EventAgentData:
[
{
EventAgentDataId: 0,
EventAgentRegistrationId: 0,
EventFieldId: 0,
Value: String
}
]
}