| Requires any of the roles: | Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator |
| GET,POST,DELETE,OPTIONS | /v1/CustomerCheckins/{Id} | ||
|---|---|---|---|
| GET,POST,DELETE,OPTIONS | /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 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 LineQuestion implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var string */
public string $CustomerCheckInId='',
/** @var string */
public string $LineId='',
/** @var string|null */
public ?string $Question=null,
/** @var string|null */
public ?string $Answer=null,
/** @var bool|null */
public ?bool $Active=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['CustomerCheckInId'])) $this->CustomerCheckInId = $o['CustomerCheckInId'];
if (isset($o['LineId'])) $this->LineId = $o['LineId'];
if (isset($o['Question'])) $this->Question = $o['Question'];
if (isset($o['Answer'])) $this->Answer = $o['Answer'];
if (isset($o['Active'])) $this->Active = $o['Active'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->CustomerCheckInId)) $o['CustomerCheckInId'] = $this->CustomerCheckInId;
if (isset($this->LineId)) $o['LineId'] = $this->LineId;
if (isset($this->Question)) $o['Question'] = $this->Question;
if (isset($this->Answer)) $o['Answer'] = $this->Answer;
if (isset($this->Active)) $o['Active'] = $this->Active;
return empty($o) ? new class(){} : $o;
}
}
class LineImage implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ImageId=null,
/** @var string|null */
public ?string $FileName=null,
/** @var string|null */
public ?string $ImageTitle=null,
/** @var DateTime */
public DateTime $UploadDate=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ImageId'])) $this->ImageId = $o['ImageId'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['ImageTitle'])) $this->ImageTitle = $o['ImageTitle'];
if (isset($o['UploadDate'])) $this->UploadDate = JsonConverters::from('DateTime', $o['UploadDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ImageId)) $o['ImageId'] = $this->ImageId;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->ImageTitle)) $o['ImageTitle'] = $this->ImageTitle;
if (isset($this->UploadDate)) $o['UploadDate'] = JsonConverters::to('DateTime', $this->UploadDate);
return empty($o) ? new class(){} : $o;
}
}
class Line implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $LocationId='',
/** @var string|null */
public ?string $LocationName=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description=null,
/** @var int */
public int $ServiceDurationMinutes=0,
/** @var int */
public int $WaitTime=0,
/** @var float */
public float $Cost=0.0,
/** @var int|null */
public ?int $UpperThreshold=null,
/** @var int|null */
public ?int $LowerThreshold=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var DateTime|null */
public ?DateTime $EntDate=null,
/** @var DateTime|null */
public ?DateTime $ModDate=null,
/** @var bool|null */
public ?bool $SendQuestionnaire=null,
/** @var bool|null */
public ?bool $RequireUpload=null,
/** @var string|null */
public ?string $UploadMessage=null,
/** @var array<LineImage>|null */
public ?array $LineImages=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ServiceDurationMinutes'])) $this->ServiceDurationMinutes = $o['ServiceDurationMinutes'];
if (isset($o['WaitTime'])) $this->WaitTime = $o['WaitTime'];
if (isset($o['Cost'])) $this->Cost = $o['Cost'];
if (isset($o['UpperThreshold'])) $this->UpperThreshold = $o['UpperThreshold'];
if (isset($o['LowerThreshold'])) $this->LowerThreshold = $o['LowerThreshold'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['EntDate'])) $this->EntDate = JsonConverters::from('DateTime', $o['EntDate']);
if (isset($o['ModDate'])) $this->ModDate = JsonConverters::from('DateTime', $o['ModDate']);
if (isset($o['SendQuestionnaire'])) $this->SendQuestionnaire = $o['SendQuestionnaire'];
if (isset($o['RequireUpload'])) $this->RequireUpload = $o['RequireUpload'];
if (isset($o['UploadMessage'])) $this->UploadMessage = $o['UploadMessage'];
if (isset($o['LineImages'])) $this->LineImages = JsonConverters::fromArray('LineImage', $o['LineImages']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ServiceDurationMinutes)) $o['ServiceDurationMinutes'] = $this->ServiceDurationMinutes;
if (isset($this->WaitTime)) $o['WaitTime'] = $this->WaitTime;
if (isset($this->Cost)) $o['Cost'] = $this->Cost;
if (isset($this->UpperThreshold)) $o['UpperThreshold'] = $this->UpperThreshold;
if (isset($this->LowerThreshold)) $o['LowerThreshold'] = $this->LowerThreshold;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->EntDate)) $o['EntDate'] = JsonConverters::to('DateTime', $this->EntDate);
if (isset($this->ModDate)) $o['ModDate'] = JsonConverters::to('DateTime', $this->ModDate);
if (isset($this->SendQuestionnaire)) $o['SendQuestionnaire'] = $this->SendQuestionnaire;
if (isset($this->RequireUpload)) $o['RequireUpload'] = $this->RequireUpload;
if (isset($this->UploadMessage)) $o['UploadMessage'] = $this->UploadMessage;
if (isset($this->LineImages)) $o['LineImages'] = JsonConverters::toArray('LineImage', $this->LineImages);
return empty($o) ? new class(){} : $o;
}
}
class CheckinInformation implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $LocationId='',
/** @var string|null */
public ?string $LocationName=null,
/** @var string|null */
public ?string $CustomerId=null,
/** @var bool|null */
public ?bool $QuestionnaireSubmitted=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description=null,
/** @var int */
public int $TotalServiceDurationMinutes=0,
/** @var float */
public float $TotalCost=0.0,
/** @var bool|null */
public ?bool $SendQuestionnaire=null,
/** @var bool|null */
public ?bool $RequireUpload=null,
/** @var array<LineQuestion>|null */
public ?array $Questions=null,
/** @var array<Line>|null */
public ?array $Lines=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
if (isset($o['QuestionnaireSubmitted'])) $this->QuestionnaireSubmitted = $o['QuestionnaireSubmitted'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['TotalServiceDurationMinutes'])) $this->TotalServiceDurationMinutes = $o['TotalServiceDurationMinutes'];
if (isset($o['TotalCost'])) $this->TotalCost = $o['TotalCost'];
if (isset($o['SendQuestionnaire'])) $this->SendQuestionnaire = $o['SendQuestionnaire'];
if (isset($o['RequireUpload'])) $this->RequireUpload = $o['RequireUpload'];
if (isset($o['Questions'])) $this->Questions = JsonConverters::fromArray('LineQuestion', $o['Questions']);
if (isset($o['Lines'])) $this->Lines = JsonConverters::fromArray('Line', $o['Lines']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
if (isset($this->QuestionnaireSubmitted)) $o['QuestionnaireSubmitted'] = $this->QuestionnaireSubmitted;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->TotalServiceDurationMinutes)) $o['TotalServiceDurationMinutes'] = $this->TotalServiceDurationMinutes;
if (isset($this->TotalCost)) $o['TotalCost'] = $this->TotalCost;
if (isset($this->SendQuestionnaire)) $o['SendQuestionnaire'] = $this->SendQuestionnaire;
if (isset($this->RequireUpload)) $o['RequireUpload'] = $this->RequireUpload;
if (isset($this->Questions)) $o['Questions'] = JsonConverters::toArray('LineQuestion', $this->Questions);
if (isset($this->Lines)) $o['Lines'] = JsonConverters::toArray('Line', $this->Lines);
return empty($o) ? new class(){} : $o;
}
}
class CustomerCheckinsResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<CustomerCheckinObject>|null */
public ?array $CustomerCheckins=null,
/** @var CheckinInformation|null */
public ?CheckinInformation $CustomerCheckinRequirements=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['CustomerCheckins'])) $this->CustomerCheckins = JsonConverters::fromArray('CustomerCheckinObject', $o['CustomerCheckins']);
if (isset($o['CustomerCheckinRequirements'])) $this->CustomerCheckinRequirements = JsonConverters::from('CheckinInformation', $o['CustomerCheckinRequirements']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->CustomerCheckins)) $o['CustomerCheckins'] = JsonConverters::toArray('CustomerCheckinObject', $this->CustomerCheckins);
if (isset($this->CustomerCheckinRequirements)) $o['CustomerCheckinRequirements'] = JsonConverters::to('CheckinInformation', $this->CustomerCheckinRequirements);
return empty($o) ? new class(){} : $o;
}
}
class CustomerCheckins extends CustomerCheckinObject implements JsonSerializable
{
/**
* @param string $Id
* @param string $LineId
* @param string $CustomerId
* @param string $EmployeeId
* @param string $LocationId
* @param string $StationId
* @param DateTime $SignInTime
* @param DateTime $AdjustedSignInTime
* @param bool|null $SendReminders
* @param int $Status
* @param int $TaskTime
* @param bool|null $Completed
* @param DateTime $CompletedTime
* @param bool|null $QuestionnaireSubmitted
* @param array<string>|null $LineIds
*/
public function __construct(
string $Id='',
string $LineId='',
string $CustomerId='',
string $EmployeeId='',
string $LocationId='',
string $StationId='',
DateTime $SignInTime=new DateTime(),
DateTime $AdjustedSignInTime=new DateTime(),
?bool $SendReminders=null,
int $Status=0,
int $TaskTime=0,
?bool $Completed=null,
DateTime $CompletedTime=new DateTime(),
?bool $QuestionnaireSubmitted=null,
?array $LineIds=null,
/** @var string */
public string $ApiKey=''
) {
parent::__construct($Id,$LineId,$CustomerId,$EmployeeId,$LocationId,$StationId,$SignInTime,$AdjustedSignInTime,$SendReminders,$Status,$TaskTime,$Completed,$CompletedTime,$QuestionnaireSubmitted,$LineIds);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
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 /v1/CustomerCheckins/{Id} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ApiKey":"00000000000000000000000000000000","Id":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","CustomerId":"00000000000000000000000000000000","EmployeeId":"00000000000000000000000000000000","LocationId":"00000000000000000000000000000000","StationId":"00000000000000000000000000000000","SignInTime":"0001-01-01T00:00:00.0000000","AdjustedSignInTime":"0001-01-01T00:00:00.0000000","SendReminders":false,"Status":0,"TaskTime":0,"Completed":false,"CompletedTime":"0001-01-01T00:00:00.0000000","QuestionnaireSubmitted":false,"LineIds":["00000000000000000000000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"CustomerCheckins":[{"Id":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","CustomerId":"00000000000000000000000000000000","EmployeeId":"00000000000000000000000000000000","LocationId":"00000000000000000000000000000000","StationId":"00000000000000000000000000000000","SignInTime":"0001-01-01T00:00:00.0000000","AdjustedSignInTime":"0001-01-01T00:00:00.0000000","SendReminders":false,"Status":0,"TaskTime":0,"Completed":false,"CompletedTime":"0001-01-01T00:00:00.0000000","QuestionnaireSubmitted":false,"LineIds":["00000000000000000000000000000000"]}],"CustomerCheckinRequirements":{"Id":"00000000000000000000000000000000","LocationId":"00000000000000000000000000000000","LocationName":"String","CustomerId":"00000000000000000000000000000000","QuestionnaireSubmitted":false,"Name":"String","Description":"String","TotalServiceDurationMinutes":0,"TotalCost":0,"SendQuestionnaire":false,"RequireUpload":false,"Questions":[{"Id":0,"CustomerCheckInId":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","Question":"String","Answer":"String","Active":false}],"Lines":[{"Id":"00000000000000000000000000000000","LocationId":"00000000000000000000000000000000","LocationName":"String","Name":"String","Description":"String","ServiceDurationMinutes":0,"WaitTime":0,"Cost":0,"UpperThreshold":0,"LowerThreshold":0,"Active":false,"EntDate":"0001-01-01T00:00:00.0000000","ModDate":"0001-01-01T00:00:00.0000000","SendQuestionnaire":false,"RequireUpload":false,"UploadMessage":"String","LineImages":[{"ImageId":"00000000000000000000000000000000","FileName":"String","ImageTitle":"String","UploadDate":"0001-01-01T00:00:00.0000000"}]}]}}