| PUT | /v1/CustomerCheckins |
|---|
<?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 CustomerCheckinsPutResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var bool|null */
public ?bool $Success=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Success'])) $this->Success = $o['Success'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Success)) $o['Success'] = $this->Success;
return empty($o) ? new class(){} : $o;
}
}
class CustomerCheckinObject implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $LineId='',
/** @var string */
public string $CustomerId='',
/** @var string */
public string $EmployeeId='',
/** @var string */
public string $LocationId='',
/** @var string */
public string $StationId='',
/** @var DateTime */
public DateTime $SignInTime=new DateTime(),
/** @var DateTime */
public DateTime $AdjustedSignInTime=new DateTime(),
/** @var bool|null */
public ?bool $SendReminders=null,
/** @var int */
public int $Status=0,
/** @var int */
public int $TaskTime=0,
/** @var bool|null */
public ?bool $Completed=null,
/** @var DateTime */
public DateTime $CompletedTime=new DateTime(),
/** @var bool|null */
public ?bool $QuestionnaireSubmitted=null,
/** @var array<string>|null */
public ?array $LineIds=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['LineId'])) $this->LineId = $o['LineId'];
if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
if (isset($o['StationId'])) $this->StationId = $o['StationId'];
if (isset($o['SignInTime'])) $this->SignInTime = JsonConverters::from('DateTime', $o['SignInTime']);
if (isset($o['AdjustedSignInTime'])) $this->AdjustedSignInTime = JsonConverters::from('DateTime', $o['AdjustedSignInTime']);
if (isset($o['SendReminders'])) $this->SendReminders = $o['SendReminders'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['TaskTime'])) $this->TaskTime = $o['TaskTime'];
if (isset($o['Completed'])) $this->Completed = $o['Completed'];
if (isset($o['CompletedTime'])) $this->CompletedTime = JsonConverters::from('DateTime', $o['CompletedTime']);
if (isset($o['QuestionnaireSubmitted'])) $this->QuestionnaireSubmitted = $o['QuestionnaireSubmitted'];
if (isset($o['LineIds'])) $this->LineIds = JsonConverters::fromArray('Guid', $o['LineIds']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->LineId)) $o['LineId'] = $this->LineId;
if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
if (isset($this->StationId)) $o['StationId'] = $this->StationId;
if (isset($this->SignInTime)) $o['SignInTime'] = JsonConverters::to('DateTime', $this->SignInTime);
if (isset($this->AdjustedSignInTime)) $o['AdjustedSignInTime'] = JsonConverters::to('DateTime', $this->AdjustedSignInTime);
if (isset($this->SendReminders)) $o['SendReminders'] = $this->SendReminders;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->TaskTime)) $o['TaskTime'] = $this->TaskTime;
if (isset($this->Completed)) $o['Completed'] = $this->Completed;
if (isset($this->CompletedTime)) $o['CompletedTime'] = JsonConverters::to('DateTime', $this->CompletedTime);
if (isset($this->QuestionnaireSubmitted)) $o['QuestionnaireSubmitted'] = $this->QuestionnaireSubmitted;
if (isset($this->LineIds)) $o['LineIds'] = JsonConverters::toArray('Guid', $this->LineIds);
return empty($o) ? new class(){} : $o;
}
}
class CustomerCheckinsPut implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ApiKey='',
/** @var array<CustomerCheckinObject>|null */
public ?array $Checkins=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
if (isset($o['Checkins'])) $this->Checkins = JsonConverters::fromArray('CustomerCheckinObject', $o['Checkins']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
if (isset($this->Checkins)) $o['Checkins'] = JsonConverters::toArray('CustomerCheckinObject', $this->Checkins);
return empty($o) ? new class(){} : $o;
}
}
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.
PUT /v1/CustomerCheckins HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ApiKey: 00000000000000000000000000000000,
Checkins:
[
{
Id: 00000000000000000000000000000000,
LineId: 00000000000000000000000000000000,
CustomerId: 00000000000000000000000000000000,
EmployeeId: 00000000000000000000000000000000,
LocationId: 00000000000000000000000000000000,
StationId: 00000000000000000000000000000000,
SignInTime: 0001-01-01,
AdjustedSignInTime: 0001-01-01,
SendReminders: False,
Status: 0,
TaskTime: 0,
Completed: False,
CompletedTime: 0001-01-01,
QuestionnaireSubmitted: False,
LineIds:
[
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
}
},
Success: False
}