| Requires any of the roles: | Agent, Administrator, Agent, Administrator |
| GET,POST,OPTIONS | /v1/AgentEventRegistration |
|---|
<?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 AgentEventRegistration implements JsonSerializable
{
public function __construct(
/** @var string */
public string $AgentEventRegistrationId='',
/** @var string */
public string $EventRegistrationId='',
/** @var string */
public string $UserId='',
/** @var int */
public int $NumberAttending=0,
/** @var float */
public float $TotalCost=0.0,
/** @var string|null */
public ?string $StripeChargeId=null,
/** @var DateTime */
public DateTime $DateCreated=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AgentEventRegistrationId'])) $this->AgentEventRegistrationId = $o['AgentEventRegistrationId'];
if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
if (isset($o['UserId'])) $this->UserId = $o['UserId'];
if (isset($o['NumberAttending'])) $this->NumberAttending = $o['NumberAttending'];
if (isset($o['TotalCost'])) $this->TotalCost = $o['TotalCost'];
if (isset($o['StripeChargeId'])) $this->StripeChargeId = $o['StripeChargeId'];
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AgentEventRegistrationId)) $o['AgentEventRegistrationId'] = $this->AgentEventRegistrationId;
if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
if (isset($this->UserId)) $o['UserId'] = $this->UserId;
if (isset($this->NumberAttending)) $o['NumberAttending'] = $this->NumberAttending;
if (isset($this->TotalCost)) $o['TotalCost'] = $this->TotalCost;
if (isset($this->StripeChargeId)) $o['StripeChargeId'] = $this->StripeChargeId;
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
return empty($o) ? new class(){} : $o;
}
}
class AgentEventRegistrationResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<AgentEventRegistration>|null */
public ?array $AgentEventRegistration=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['AgentEventRegistration'])) $this->AgentEventRegistration = JsonConverters::fromArray('AgentEventRegistration', $o['AgentEventRegistration']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->AgentEventRegistration)) $o['AgentEventRegistration'] = JsonConverters::toArray('AgentEventRegistration', $this->AgentEventRegistration);
return empty($o) ? new class(){} : $o;
}
}
class AgentEventRegistrationRequest implements JsonSerializable
{
public function __construct(
/** @var array<AgentEventRegistration>|null */
public ?array $AgentEventRegistration=null,
/** @var string|null */
public ?string $StripeToken=null,
/** @var string|null */
public ?string $RegistrationDescription=null,
/** @var string */
public string $EventRegistrationId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AgentEventRegistration'])) $this->AgentEventRegistration = JsonConverters::fromArray('AgentEventRegistration', $o['AgentEventRegistration']);
if (isset($o['StripeToken'])) $this->StripeToken = $o['StripeToken'];
if (isset($o['RegistrationDescription'])) $this->RegistrationDescription = $o['RegistrationDescription'];
if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AgentEventRegistration)) $o['AgentEventRegistration'] = JsonConverters::toArray('AgentEventRegistration', $this->AgentEventRegistration);
if (isset($this->StripeToken)) $o['StripeToken'] = $this->StripeToken;
if (isset($this->RegistrationDescription)) $o['RegistrationDescription'] = $this->RegistrationDescription;
if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
return empty($o) ? new class(){} : $o;
}
}
PHP AgentEventRegistrationRequest 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.
POST /v1/AgentEventRegistration HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"AgentEventRegistration":[{"AgentEventRegistrationId":"00000000000000000000000000000000","EventRegistrationId":"00000000000000000000000000000000","UserId":"00000000000000000000000000000000","NumberAttending":0,"TotalCost":0,"StripeChargeId":"String","DateCreated":"0001-01-01T00:00:00.0000000"}],"StripeToken":"String","RegistrationDescription":"String","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"}},"AgentEventRegistration":[{"AgentEventRegistrationId":"00000000000000000000000000000000","EventRegistrationId":"00000000000000000000000000000000","UserId":"00000000000000000000000000000000","NumberAttending":0,"TotalCost":0,"StripeChargeId":"String","DateCreated":"0001-01-01T00:00:00.0000000"}]}