| GET POST | /api/projects/count |
|---|
<?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 RegistrationProfileFieldValue implements JsonSerializable
{
public function __construct(
/** @var string */
public string $DocumentFieldID='',
/** @var string|null */
public ?string $Value=null,
/** @var string|null */
public ?string $ShadowValue=null,
/** @var bool|null */
public ?bool $IsModifiedByUser=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DocumentFieldID'])) $this->DocumentFieldID = $o['DocumentFieldID'];
if (isset($o['Value'])) $this->Value = $o['Value'];
if (isset($o['ShadowValue'])) $this->ShadowValue = $o['ShadowValue'];
if (isset($o['IsModifiedByUser'])) $this->IsModifiedByUser = $o['IsModifiedByUser'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DocumentFieldID)) $o['DocumentFieldID'] = $this->DocumentFieldID;
if (isset($this->Value)) $o['Value'] = $this->Value;
if (isset($this->ShadowValue)) $o['ShadowValue'] = $this->ShadowValue;
if (isset($this->IsModifiedByUser)) $o['IsModifiedByUser'] = $this->IsModifiedByUser;
return empty($o) ? new class(){} : $o;
}
}
class GetProjectsCount implements ISearchCriteria, IModifiedSince, JsonSerializable
{
public function __construct(
/** @var int */
public int $PageSize=0,
/** @var int */
public int $PageNumber=0,
/** @var DateTime|null */
public ?DateTime $ModifiedSince=null,
/** @var string|null */
public ?string $SearchCriteria=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var string */
public string $RegistrationProfileFieldID='',
/** @var array<RegistrationProfileFieldValue>|null */
public ?array $DependableFields=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
if (isset($o['PageNumber'])) $this->PageNumber = $o['PageNumber'];
if (isset($o['ModifiedSince'])) $this->ModifiedSince = JsonConverters::from('DateTime', $o['ModifiedSince']);
if (isset($o['SearchCriteria'])) $this->SearchCriteria = $o['SearchCriteria'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['RegistrationProfileFieldID'])) $this->RegistrationProfileFieldID = $o['RegistrationProfileFieldID'];
if (isset($o['DependableFields'])) $this->DependableFields = JsonConverters::fromArray('RegistrationProfileFieldValue', $o['DependableFields']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
if (isset($this->PageNumber)) $o['PageNumber'] = $this->PageNumber;
if (isset($this->ModifiedSince)) $o['ModifiedSince'] = JsonConverters::to('DateTime', $this->ModifiedSince);
if (isset($this->SearchCriteria)) $o['SearchCriteria'] = $this->SearchCriteria;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->RegistrationProfileFieldID)) $o['RegistrationProfileFieldID'] = $this->RegistrationProfileFieldID;
if (isset($this->DependableFields)) $o['DependableFields'] = JsonConverters::toArray('RegistrationProfileFieldValue', $this->DependableFields);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/projects/count HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"PageSize":0,"PageNumber":0,"ModifiedSince":"0001-01-01T00:00:00.0000000","SearchCriteria":"String","Active":false,"RegistrationProfileFieldID":"00000000-0000-0000-0000-000000000000","DependableFields":[{"DocumentFieldID":"00000000-0000-0000-0000-000000000000","Value":"String","ShadowValue":"String","IsModifiedByUser":false}]}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length 0