| POST | /user/register |
|---|
<?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 ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
public function __construct(
/** @description The API Key required for authentication */
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
/** @var string */
public string $apiKey='',
/** @description Latitude of the user making this request */
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
/** @var float */
public float $latitude=0.0,
/** @description Longitude of the user making this request */
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
/** @var float */
public float $longitude=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['apiKey'])) $this->apiKey = $o['apiKey'];
if (isset($o['latitude'])) $this->latitude = $o['latitude'];
if (isset($o['longitude'])) $this->longitude = $o['longitude'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->apiKey)) $o['apiKey'] = $this->apiKey;
if (isset($this->latitude)) $o['latitude'] = $this->latitude;
if (isset($this->longitude)) $o['longitude'] = $this->longitude;
return empty($o) ? new class(){} : $o;
}
}
class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $heading=null,
/** @var bool|null */
public ?bool $wasSuccessful=null,
/** @var Object|null */
public ?Object $modelState=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['heading'])) $this->heading = $o['heading'];
if (isset($o['wasSuccessful'])) $this->wasSuccessful = $o['wasSuccessful'];
if (isset($o['modelState'])) $this->modelState = JsonConverters::from('Object', $o['modelState']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->heading)) $o['heading'] = $this->heading;
if (isset($this->wasSuccessful)) $o['wasSuccessful'] = $this->wasSuccessful;
if (isset($this->modelState)) $o['modelState'] = JsonConverters::to('Object', $this->modelState);
return empty($o) ? new class(){} : $o;
}
}
class RatesItem implements JsonSerializable
{
public function __construct(
/** @var float */
public float $rate=0.0,
/** @var int */
public int $minutes=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['rate'])) $this->rate = $o['rate'];
if (isset($o['minutes'])) $this->minutes = $o['minutes'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->rate)) $o['rate'] = $this->rate;
if (isset($this->minutes)) $o['minutes'] = $this->minutes;
return empty($o) ? new class(){} : $o;
}
}
class FacilityData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $facilityId=0,
/** @var string|null */
public ?string $facilityGuid=null,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $description=null,
/** @var string|null */
public ?string $nextAvailable=null,
/** @var bool|null */
public ?bool $hasNextAvailable=null,
/** @var array<RatesItem>|null */
public ?array $rates=null,
/** @var string|null */
public ?string $themeColor=null,
/** @var string|null */
public ?string $bookingNotes=null,
/** @var int */
public int $leadTime=0,
/** @var int */
public int $venueId=0,
/** @var bool|null */
public ?bool $allowExtraRequirements=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['facilityId'])) $this->facilityId = $o['facilityId'];
if (isset($o['facilityGuid'])) $this->facilityGuid = $o['facilityGuid'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['nextAvailable'])) $this->nextAvailable = $o['nextAvailable'];
if (isset($o['hasNextAvailable'])) $this->hasNextAvailable = $o['hasNextAvailable'];
if (isset($o['rates'])) $this->rates = JsonConverters::fromArray('RatesItem', $o['rates']);
if (isset($o['themeColor'])) $this->themeColor = $o['themeColor'];
if (isset($o['bookingNotes'])) $this->bookingNotes = $o['bookingNotes'];
if (isset($o['leadTime'])) $this->leadTime = $o['leadTime'];
if (isset($o['venueId'])) $this->venueId = $o['venueId'];
if (isset($o['allowExtraRequirements'])) $this->allowExtraRequirements = $o['allowExtraRequirements'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->facilityId)) $o['facilityId'] = $this->facilityId;
if (isset($this->facilityGuid)) $o['facilityGuid'] = $this->facilityGuid;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->nextAvailable)) $o['nextAvailable'] = $this->nextAvailable;
if (isset($this->hasNextAvailable)) $o['hasNextAvailable'] = $this->hasNextAvailable;
if (isset($this->rates)) $o['rates'] = JsonConverters::toArray('RatesItem', $this->rates);
if (isset($this->themeColor)) $o['themeColor'] = $this->themeColor;
if (isset($this->bookingNotes)) $o['bookingNotes'] = $this->bookingNotes;
if (isset($this->leadTime)) $o['leadTime'] = $this->leadTime;
if (isset($this->venueId)) $o['venueId'] = $this->venueId;
if (isset($this->allowExtraRequirements)) $o['allowExtraRequirements'] = $this->allowExtraRequirements;
return empty($o) ? new class(){} : $o;
}
}
class VenueData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $venueId=0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $registeredDate=null,
/** @var string|null */
public ?string $venueCode=null,
/** @var bool|null */
public ?bool $isCoordinator=null,
/** @var array<FacilityData>|null */
public ?array $facilities=null,
/** @var float */
public float $latitude=0.0,
/** @var float */
public float $longitude=0.0,
/** @var bool|null */
public ?bool $hasLocation=null,
/** @var string|null */
public ?string $logoUrl=null,
/** @var int */
public int $leadTime=0,
/** @var string|null */
public ?string $venueInfo=null,
/** @var bool|null */
public ?bool $allowGuests=null,
/** @var string|null */
public ?string $contactNumber=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['venueId'])) $this->venueId = $o['venueId'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['registeredDate'])) $this->registeredDate = $o['registeredDate'];
if (isset($o['venueCode'])) $this->venueCode = $o['venueCode'];
if (isset($o['isCoordinator'])) $this->isCoordinator = $o['isCoordinator'];
if (isset($o['facilities'])) $this->facilities = JsonConverters::fromArray('FacilityData', $o['facilities']);
if (isset($o['latitude'])) $this->latitude = $o['latitude'];
if (isset($o['longitude'])) $this->longitude = $o['longitude'];
if (isset($o['hasLocation'])) $this->hasLocation = $o['hasLocation'];
if (isset($o['logoUrl'])) $this->logoUrl = $o['logoUrl'];
if (isset($o['leadTime'])) $this->leadTime = $o['leadTime'];
if (isset($o['venueInfo'])) $this->venueInfo = $o['venueInfo'];
if (isset($o['allowGuests'])) $this->allowGuests = $o['allowGuests'];
if (isset($o['contactNumber'])) $this->contactNumber = $o['contactNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->venueId)) $o['venueId'] = $this->venueId;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->registeredDate)) $o['registeredDate'] = $this->registeredDate;
if (isset($this->venueCode)) $o['venueCode'] = $this->venueCode;
if (isset($this->isCoordinator)) $o['isCoordinator'] = $this->isCoordinator;
if (isset($this->facilities)) $o['facilities'] = JsonConverters::toArray('FacilityData', $this->facilities);
if (isset($this->latitude)) $o['latitude'] = $this->latitude;
if (isset($this->longitude)) $o['longitude'] = $this->longitude;
if (isset($this->hasLocation)) $o['hasLocation'] = $this->hasLocation;
if (isset($this->logoUrl)) $o['logoUrl'] = $this->logoUrl;
if (isset($this->leadTime)) $o['leadTime'] = $this->leadTime;
if (isset($this->venueInfo)) $o['venueInfo'] = $this->venueInfo;
if (isset($this->allowGuests)) $o['allowGuests'] = $this->allowGuests;
if (isset($this->contactNumber)) $o['contactNumber'] = $this->contactNumber;
return empty($o) ? new class(){} : $o;
}
}
class UserCustomFieldData implements JsonSerializable
{
public function __construct(
/** @var string */
public string $id='',
/** @var string|null */
public ?string $value=null,
/** @var string|null */
public ?string $name=null,
/** @var bool|null */
public ?bool $optional=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['value'])) $this->value = $o['value'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['optional'])) $this->optional = $o['optional'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->value)) $o['value'] = $this->value;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->optional)) $o['optional'] = $this->optional;
return empty($o) ? new class(){} : $o;
}
}
class VenueCustomField implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $venueName=null,
/** @var int */
public int $venueId=0,
/** @var array<UserCustomFieldData>|null */
public ?array $fields=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['venueName'])) $this->venueName = $o['venueName'];
if (isset($o['venueId'])) $this->venueId = $o['venueId'];
if (isset($o['fields'])) $this->fields = JsonConverters::fromArray('UserCustomFieldData', $o['fields']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->venueName)) $o['venueName'] = $this->venueName;
if (isset($this->venueId)) $o['venueId'] = $this->venueId;
if (isset($this->fields)) $o['fields'] = JsonConverters::toArray('UserCustomFieldData', $this->fields);
return empty($o) ? new class(){} : $o;
}
}
class LoginData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $systemUserId=0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $emailAddress=null,
/** @var string|null */
public ?string $mobileNumber=null,
/** @var string|null */
public ?string $refreshToken=null,
/** @var string|null */
public ?string $refreshTokenExpiry=null,
/** @var array<VenueData>|null */
public ?array $venues=null,
/** @var array<VenueCustomField>|null */
public ?array $venueCustomFields=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['systemUserId'])) $this->systemUserId = $o['systemUserId'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['emailAddress'])) $this->emailAddress = $o['emailAddress'];
if (isset($o['mobileNumber'])) $this->mobileNumber = $o['mobileNumber'];
if (isset($o['refreshToken'])) $this->refreshToken = $o['refreshToken'];
if (isset($o['refreshTokenExpiry'])) $this->refreshTokenExpiry = $o['refreshTokenExpiry'];
if (isset($o['venues'])) $this->venues = JsonConverters::fromArray('VenueData', $o['venues']);
if (isset($o['venueCustomFields'])) $this->venueCustomFields = JsonConverters::fromArray('VenueCustomField', $o['venueCustomFields']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->systemUserId)) $o['systemUserId'] = $this->systemUserId;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->emailAddress)) $o['emailAddress'] = $this->emailAddress;
if (isset($this->mobileNumber)) $o['mobileNumber'] = $this->mobileNumber;
if (isset($this->refreshToken)) $o['refreshToken'] = $this->refreshToken;
if (isset($this->refreshTokenExpiry)) $o['refreshTokenExpiry'] = $this->refreshTokenExpiry;
if (isset($this->venues)) $o['venues'] = JsonConverters::toArray('VenueData', $this->venues);
if (isset($this->venueCustomFields)) $o['venueCustomFields'] = JsonConverters::toArray('VenueCustomField', $this->venueCustomFields);
return empty($o) ? new class(){} : $o;
}
}
class UserLoginResponse extends ApiServiceResponse implements JsonSerializable
{
/**
* @param string|null $description
* @param string|null $heading
* @param bool|null $wasSuccessful
* @param Object|null $modelState
*/
public function __construct(
?string $description=null,
?string $heading=null,
?bool $wasSuccessful=null,
?Object $modelState=null,
/** @var bool|null */
public ?bool $registrationRequired=null,
/** @var LoginData|null */
public ?LoginData $data=null
) {
parent::__construct($description,$heading,$wasSuccessful,$modelState);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['registrationRequired'])) $this->registrationRequired = $o['registrationRequired'];
if (isset($o['data'])) $this->data = JsonConverters::from('LoginData', $o['data']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->registrationRequired)) $o['registrationRequired'] = $this->registrationRequired;
if (isset($this->data)) $o['data'] = JsonConverters::to('LoginData', $this->data);
return empty($o) ? new class(){} : $o;
}
}
class UserRegister extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $apiKey
* @param float $latitude
* @param float $longitude
*/
public function __construct(
string $apiKey='',
float $latitude=0.0,
float $longitude=0.0,
/** @var string|null */
public ?string $mobileNumber=null,
/** @var string|null */
public ?string $googleIdToken=null,
/** @var int */
public int $utcOffset=0,
/** @var bool|null */
public ?bool $usingFirebase=null,
/** @var string|null */
public ?string $emailAddress=null,
/** @var string|null */
public ?string $displayName=null
) {
parent::__construct($apiKey,$latitude,$longitude);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['mobileNumber'])) $this->mobileNumber = $o['mobileNumber'];
if (isset($o['googleIdToken'])) $this->googleIdToken = $o['googleIdToken'];
if (isset($o['utcOffset'])) $this->utcOffset = $o['utcOffset'];
if (isset($o['usingFirebase'])) $this->usingFirebase = $o['usingFirebase'];
if (isset($o['emailAddress'])) $this->emailAddress = $o['emailAddress'];
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->mobileNumber)) $o['mobileNumber'] = $this->mobileNumber;
if (isset($this->googleIdToken)) $o['googleIdToken'] = $this->googleIdToken;
if (isset($this->utcOffset)) $o['utcOffset'] = $this->utcOffset;
if (isset($this->usingFirebase)) $o['usingFirebase'] = $this->usingFirebase;
if (isset($this->emailAddress)) $o['emailAddress'] = $this->emailAddress;
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /user/register HTTP/1.1
Host: reservation.api.dev.86degrees.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"mobileNumber":"String","googleIdToken":"String","utcOffset":0,"usingFirebase":false,"emailAddress":"String","displayName":"String","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"registrationRequired":false,"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}