| GET,PUT,DELETE,OPTIONS | /v1/EventAgentRegistration/{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 EventRegistration implements JsonSerializable
{
public function __construct(
/** @var string */
public string $EventRegistrationId='',
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $Summary=null,
/** @var string|null */
public ?string $PageContent=null,
/** @var DateTime */
public DateTime $RegistrationStart=new DateTime(),
/** @var DateTime */
public DateTime $RegistrationEnd=new DateTime(),
/** @var int */
public int $RegistrationCount=0,
/** @var bool|null */
public ?bool $Active=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['Summary'])) $this->Summary = $o['Summary'];
if (isset($o['PageContent'])) $this->PageContent = $o['PageContent'];
if (isset($o['RegistrationStart'])) $this->RegistrationStart = JsonConverters::from('DateTime', $o['RegistrationStart']);
if (isset($o['RegistrationEnd'])) $this->RegistrationEnd = JsonConverters::from('DateTime', $o['RegistrationEnd']);
if (isset($o['RegistrationCount'])) $this->RegistrationCount = $o['RegistrationCount'];
if (isset($o['Active'])) $this->Active = $o['Active'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->Summary)) $o['Summary'] = $this->Summary;
if (isset($this->PageContent)) $o['PageContent'] = $this->PageContent;
if (isset($this->RegistrationStart)) $o['RegistrationStart'] = JsonConverters::to('DateTime', $this->RegistrationStart);
if (isset($this->RegistrationEnd)) $o['RegistrationEnd'] = JsonConverters::to('DateTime', $this->RegistrationEnd);
if (isset($this->RegistrationCount)) $o['RegistrationCount'] = $this->RegistrationCount;
if (isset($this->Active)) $o['Active'] = $this->Active;
return empty($o) ? new class(){} : $o;
}
}
class EventAgentRegistration extends EventRegistration implements JsonSerializable
{
/**
* @param string $EventRegistrationId
* @param string|null $Description
* @param string|null $Summary
* @param string|null $PageContent
* @param DateTime $RegistrationStart
* @param DateTime $RegistrationEnd
* @param int $RegistrationCount
* @param bool|null $Active
*/
public function __construct(
string $EventRegistrationId='',
?string $Description=null,
?string $Summary=null,
?string $PageContent=null,
DateTime $RegistrationStart=new DateTime(),
DateTime $RegistrationEnd=new DateTime(),
int $RegistrationCount=0,
?bool $Active=null,
/** @var int */
public int $EventAgentRegistrationId=0,
/** @var int */
public int $AgentId=0,
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
/** @var bool|null */
public ?bool $IsRegistered=null
) {
parent::__construct($EventRegistrationId,$Description,$Summary,$PageContent,$RegistrationStart,$RegistrationEnd,$RegistrationCount,$Active);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['EventAgentRegistrationId'])) $this->EventAgentRegistrationId = $o['EventAgentRegistrationId'];
if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['IsRegistered'])) $this->IsRegistered = $o['IsRegistered'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->EventAgentRegistrationId)) $o['EventAgentRegistrationId'] = $this->EventAgentRegistrationId;
if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->IsRegistered)) $o['IsRegistered'] = $this->IsRegistered;
return empty($o) ? new class(){} : $o;
}
}
class EventAgentRegistrationResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<EventAgentRegistration>|null */
public ?array $EventAgentRegistration=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['EventAgentRegistration'])) $this->EventAgentRegistration = JsonConverters::fromArray('EventAgentRegistration', $o['EventAgentRegistration']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->EventAgentRegistration)) $o['EventAgentRegistration'] = JsonConverters::toArray('EventAgentRegistration', $this->EventAgentRegistration);
return empty($o) ? new class(){} : $o;
}
}
class EventAgentRegistrationRequest implements JsonSerializable
{
public function __construct(
/** @var array<EventAgentRegistration>|null */
public ?array $EventAgentRegistration=null,
/** @var string */
public string $EventRegistrationId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['EventAgentRegistration'])) $this->EventAgentRegistration = JsonConverters::fromArray('EventAgentRegistration', $o['EventAgentRegistration']);
if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->EventAgentRegistration)) $o['EventAgentRegistration'] = JsonConverters::toArray('EventAgentRegistration', $this->EventAgentRegistration);
if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
return empty($o) ? new class(){} : $o;
}
}
PHP EventAgentRegistrationRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/EventAgentRegistration/{EventRegistrationId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"EventAgentRegistration":[{"EventAgentRegistrationId":0,"AgentId":0,"DateCreated":"0001-01-01T00:00:00.0000000","IsRegistered":false,"EventRegistrationId":"00000000000000000000000000000000","Description":"String","Summary":"String","PageContent":"String","RegistrationStart":"0001-01-01T00:00:00.0000000","RegistrationEnd":"0001-01-01T00:00:00.0000000","RegistrationCount":0,"Active":false}],"EventRegistrationId":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"EventAgentRegistration":[{"EventAgentRegistrationId":0,"AgentId":0,"DateCreated":"0001-01-01T00:00:00.0000000","IsRegistered":false,"EventRegistrationId":"00000000000000000000000000000000","Description":"String","Summary":"String","PageContent":"String","RegistrationStart":"0001-01-01T00:00:00.0000000","RegistrationEnd":"0001-01-01T00:00:00.0000000","RegistrationCount":0,"Active":false}]}