| GET | /api/companies/lookup |
|---|
<?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 CompanyLookupEntry implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ChamberNr=null,
/** @var string|null */
public ?string $ChamberEstablishmentNumber=null,
/** @var string|null */
public ?string $LegalName=null,
/** @var string|null */
public ?string $TradeName=null,
/** @var string|null */
public ?string $MatchType=null,
/** @var string|null */
public ?string $EstablishmentCity=null,
/** @var string|null */
public ?string $EstablishmentStreet=null,
/** @var string|null */
public ?string $CorrespondenceCity=null,
/** @var string|null */
public ?string $CorrespondenceStreet=null,
/** @var bool|null */
public ?bool $IndicationMainEstablishment=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ChamberNr'])) $this->ChamberNr = $o['ChamberNr'];
if (isset($o['ChamberEstablishmentNumber'])) $this->ChamberEstablishmentNumber = $o['ChamberEstablishmentNumber'];
if (isset($o['LegalName'])) $this->LegalName = $o['LegalName'];
if (isset($o['TradeName'])) $this->TradeName = $o['TradeName'];
if (isset($o['MatchType'])) $this->MatchType = $o['MatchType'];
if (isset($o['EstablishmentCity'])) $this->EstablishmentCity = $o['EstablishmentCity'];
if (isset($o['EstablishmentStreet'])) $this->EstablishmentStreet = $o['EstablishmentStreet'];
if (isset($o['CorrespondenceCity'])) $this->CorrespondenceCity = $o['CorrespondenceCity'];
if (isset($o['CorrespondenceStreet'])) $this->CorrespondenceStreet = $o['CorrespondenceStreet'];
if (isset($o['IndicationMainEstablishment'])) $this->IndicationMainEstablishment = $o['IndicationMainEstablishment'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ChamberNr)) $o['ChamberNr'] = $this->ChamberNr;
if (isset($this->ChamberEstablishmentNumber)) $o['ChamberEstablishmentNumber'] = $this->ChamberEstablishmentNumber;
if (isset($this->LegalName)) $o['LegalName'] = $this->LegalName;
if (isset($this->TradeName)) $o['TradeName'] = $this->TradeName;
if (isset($this->MatchType)) $o['MatchType'] = $this->MatchType;
if (isset($this->EstablishmentCity)) $o['EstablishmentCity'] = $this->EstablishmentCity;
if (isset($this->EstablishmentStreet)) $o['EstablishmentStreet'] = $this->EstablishmentStreet;
if (isset($this->CorrespondenceCity)) $o['CorrespondenceCity'] = $this->CorrespondenceCity;
if (isset($this->CorrespondenceStreet)) $o['CorrespondenceStreet'] = $this->CorrespondenceStreet;
if (isset($this->IndicationMainEstablishment)) $o['IndicationMainEstablishment'] = $this->IndicationMainEstablishment;
return empty($o) ? new class(){} : $o;
}
}
class PagingResultsInfo implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CurrentPage=0,
/** @var int */
public int $MaxResultsPerPage=0,
/** @var int */
public int $NumberOfPages=0,
/** @var int */
public int $NumberOfResults=0,
/** @var int */
public int $MaximumResults=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CurrentPage'])) $this->CurrentPage = $o['CurrentPage'];
if (isset($o['MaxResultsPerPage'])) $this->MaxResultsPerPage = $o['MaxResultsPerPage'];
if (isset($o['NumberOfPages'])) $this->NumberOfPages = $o['NumberOfPages'];
if (isset($o['NumberOfResults'])) $this->NumberOfResults = $o['NumberOfResults'];
if (isset($o['MaximumResults'])) $this->MaximumResults = $o['MaximumResults'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CurrentPage)) $o['CurrentPage'] = $this->CurrentPage;
if (isset($this->MaxResultsPerPage)) $o['MaxResultsPerPage'] = $this->MaxResultsPerPage;
if (isset($this->NumberOfPages)) $o['NumberOfPages'] = $this->NumberOfPages;
if (isset($this->NumberOfResults)) $o['NumberOfResults'] = $this->NumberOfResults;
if (isset($this->MaximumResults)) $o['MaximumResults'] = $this->MaximumResults;
return empty($o) ? new class(){} : $o;
}
}
class CompanyLookupSearchResults implements JsonSerializable
{
public function __construct(
/** @var array<CompanyLookupEntry>|null */
public ?array $Results=null,
/** @var PagingResultsInfo|null */
public ?PagingResultsInfo $PagingResultsInfo=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Results'])) $this->Results = JsonConverters::fromArray('CompanyLookupEntry', $o['Results']);
if (isset($o['PagingResultsInfo'])) $this->PagingResultsInfo = JsonConverters::from('PagingResultsInfo', $o['PagingResultsInfo']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Results)) $o['Results'] = JsonConverters::toArray('CompanyLookupEntry', $this->Results);
if (isset($this->PagingResultsInfo)) $o['PagingResultsInfo'] = JsonConverters::to('PagingResultsInfo', $this->PagingResultsInfo);
return empty($o) ? new class(){} : $o;
}
}
class GetCompaniesLookup implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ChamberNr=null,
/** @var string|null */
public ?string $TradeName=null,
/** @var string|null */
public ?string $City=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ChamberNr'])) $this->ChamberNr = $o['ChamberNr'];
if (isset($o['TradeName'])) $this->TradeName = $o['TradeName'];
if (isset($o['City'])) $this->City = $o['City'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ChamberNr)) $o['ChamberNr'] = $this->ChamberNr;
if (isset($this->TradeName)) $o['TradeName'] = $this->TradeName;
if (isset($this->City)) $o['City'] = $this->City;
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.
GET /api/companies/lookup HTTP/1.1 Host: dogw.klokgroep.nl Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Results":[],"PagingResultsInfo":{"CurrentPage":0,"MaxResultsPerPage":0,"NumberOfPages":0,"NumberOfResults":0,"MaximumResults":0}}