| GET | /api/companies/lookup/{ChamberNr} |
|---|
<?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 CompanyLookupDetails implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ChamberNr=null,
/** @var string|null */
public ?string $ChamberEstablishmentNumber=null,
/** @var string|null */
public ?string $CompanyLegalName=null,
/** @var string|null */
public ?string $CompanyTradeName=null,
/** @var string|null */
public ?string $ChamberCity=null,
/** @var DateTime|null */
public ?DateTime $ChamberFoundingDate=null,
/** @var string|null */
public ?string $EstablishmentStreet=null,
/** @var string|null */
public ?string $EstablishmentHouseNr=null,
/** @var string|null */
public ?string $EstablishmentHouseNrAddition=null,
/** @var string|null */
public ?string $EstablishmentPostalCode=null,
/** @var string|null */
public ?string $EstablishmentCity=null,
/** @var string|null */
public ?string $EstablishmentCountryTLA=null,
/** @var string|null */
public ?string $CorrespondenceStreet=null,
/** @var string|null */
public ?string $CorrespondenceHouseNr=null,
/** @var string|null */
public ?string $CorrespondenceHouseNrAddition=null,
/** @var string|null */
public ?string $CorrespondencePostalCode=null,
/** @var string|null */
public ?string $CorrespondenceCity=null,
/** @var string|null */
public ?string $CorrespondenceCountryTLA=null,
/** @var string|null */
public ?string $Website=null,
/** @var string|null */
public ?string $Telephone=null,
/** @var string|null */
public ?string $Mobile=null,
/** @var string|null */
public ?string $EMail=null,
/** @var bool|null */
public ?bool $DebtorInPossession=null,
/** @var bool|null */
public ?bool $Bankrupt=null,
/** @var array<string,Object>|null */
public ?array $ExtraFields=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['CompanyLegalName'])) $this->CompanyLegalName = $o['CompanyLegalName'];
if (isset($o['CompanyTradeName'])) $this->CompanyTradeName = $o['CompanyTradeName'];
if (isset($o['ChamberCity'])) $this->ChamberCity = $o['ChamberCity'];
if (isset($o['ChamberFoundingDate'])) $this->ChamberFoundingDate = JsonConverters::from('DateTime', $o['ChamberFoundingDate']);
if (isset($o['EstablishmentStreet'])) $this->EstablishmentStreet = $o['EstablishmentStreet'];
if (isset($o['EstablishmentHouseNr'])) $this->EstablishmentHouseNr = $o['EstablishmentHouseNr'];
if (isset($o['EstablishmentHouseNrAddition'])) $this->EstablishmentHouseNrAddition = $o['EstablishmentHouseNrAddition'];
if (isset($o['EstablishmentPostalCode'])) $this->EstablishmentPostalCode = $o['EstablishmentPostalCode'];
if (isset($o['EstablishmentCity'])) $this->EstablishmentCity = $o['EstablishmentCity'];
if (isset($o['EstablishmentCountryTLA'])) $this->EstablishmentCountryTLA = $o['EstablishmentCountryTLA'];
if (isset($o['CorrespondenceStreet'])) $this->CorrespondenceStreet = $o['CorrespondenceStreet'];
if (isset($o['CorrespondenceHouseNr'])) $this->CorrespondenceHouseNr = $o['CorrespondenceHouseNr'];
if (isset($o['CorrespondenceHouseNrAddition'])) $this->CorrespondenceHouseNrAddition = $o['CorrespondenceHouseNrAddition'];
if (isset($o['CorrespondencePostalCode'])) $this->CorrespondencePostalCode = $o['CorrespondencePostalCode'];
if (isset($o['CorrespondenceCity'])) $this->CorrespondenceCity = $o['CorrespondenceCity'];
if (isset($o['CorrespondenceCountryTLA'])) $this->CorrespondenceCountryTLA = $o['CorrespondenceCountryTLA'];
if (isset($o['Website'])) $this->Website = $o['Website'];
if (isset($o['Telephone'])) $this->Telephone = $o['Telephone'];
if (isset($o['Mobile'])) $this->Mobile = $o['Mobile'];
if (isset($o['EMail'])) $this->EMail = $o['EMail'];
if (isset($o['DebtorInPossession'])) $this->DebtorInPossession = $o['DebtorInPossession'];
if (isset($o['Bankrupt'])) $this->Bankrupt = $o['Bankrupt'];
if (isset($o['ExtraFields'])) $this->ExtraFields = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $o['ExtraFields']);
}
/** @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->CompanyLegalName)) $o['CompanyLegalName'] = $this->CompanyLegalName;
if (isset($this->CompanyTradeName)) $o['CompanyTradeName'] = $this->CompanyTradeName;
if (isset($this->ChamberCity)) $o['ChamberCity'] = $this->ChamberCity;
if (isset($this->ChamberFoundingDate)) $o['ChamberFoundingDate'] = JsonConverters::to('DateTime', $this->ChamberFoundingDate);
if (isset($this->EstablishmentStreet)) $o['EstablishmentStreet'] = $this->EstablishmentStreet;
if (isset($this->EstablishmentHouseNr)) $o['EstablishmentHouseNr'] = $this->EstablishmentHouseNr;
if (isset($this->EstablishmentHouseNrAddition)) $o['EstablishmentHouseNrAddition'] = $this->EstablishmentHouseNrAddition;
if (isset($this->EstablishmentPostalCode)) $o['EstablishmentPostalCode'] = $this->EstablishmentPostalCode;
if (isset($this->EstablishmentCity)) $o['EstablishmentCity'] = $this->EstablishmentCity;
if (isset($this->EstablishmentCountryTLA)) $o['EstablishmentCountryTLA'] = $this->EstablishmentCountryTLA;
if (isset($this->CorrespondenceStreet)) $o['CorrespondenceStreet'] = $this->CorrespondenceStreet;
if (isset($this->CorrespondenceHouseNr)) $o['CorrespondenceHouseNr'] = $this->CorrespondenceHouseNr;
if (isset($this->CorrespondenceHouseNrAddition)) $o['CorrespondenceHouseNrAddition'] = $this->CorrespondenceHouseNrAddition;
if (isset($this->CorrespondencePostalCode)) $o['CorrespondencePostalCode'] = $this->CorrespondencePostalCode;
if (isset($this->CorrespondenceCity)) $o['CorrespondenceCity'] = $this->CorrespondenceCity;
if (isset($this->CorrespondenceCountryTLA)) $o['CorrespondenceCountryTLA'] = $this->CorrespondenceCountryTLA;
if (isset($this->Website)) $o['Website'] = $this->Website;
if (isset($this->Telephone)) $o['Telephone'] = $this->Telephone;
if (isset($this->Mobile)) $o['Mobile'] = $this->Mobile;
if (isset($this->EMail)) $o['EMail'] = $this->EMail;
if (isset($this->DebtorInPossession)) $o['DebtorInPossession'] = $this->DebtorInPossession;
if (isset($this->Bankrupt)) $o['Bankrupt'] = $this->Bankrupt;
if (isset($this->ExtraFields)) $o['ExtraFields'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $this->ExtraFields);
return empty($o) ? new class(){} : $o;
}
}
class GetCompanyLookupDetails implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ChamberNr=null,
/** @var string|null */
public ?string $ChamberEstablishmentNumber=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ChamberNr'])) $this->ChamberNr = $o['ChamberNr'];
if (isset($o['ChamberEstablishmentNumber'])) $this->ChamberEstablishmentNumber = $o['ChamberEstablishmentNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ChamberNr)) $o['ChamberNr'] = $this->ChamberNr;
if (isset($this->ChamberEstablishmentNumber)) $o['ChamberEstablishmentNumber'] = $this->ChamberEstablishmentNumber;
return empty($o) ? new class(){} : $o;
}
}
PHP GetCompanyLookupDetails DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/companies/lookup/{ChamberNr} HTTP/1.1
Host: dogw.klokgroep.nl
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CompanyLookupDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.CompanyLookup.DTO">
<Bankrupt>false</Bankrupt>
<ChamberCity>String</ChamberCity>
<ChamberEstablishmentNumber>String</ChamberEstablishmentNumber>
<ChamberFoundingDate>0001-01-01T00:00:00</ChamberFoundingDate>
<ChamberNr>String</ChamberNr>
<CompanyLegalName>String</CompanyLegalName>
<CompanyTradeName>String</CompanyTradeName>
<CorrespondenceCity>String</CorrespondenceCity>
<CorrespondenceCountryTLA>String</CorrespondenceCountryTLA>
<CorrespondenceHouseNr>String</CorrespondenceHouseNr>
<CorrespondenceHouseNrAddition>String</CorrespondenceHouseNrAddition>
<CorrespondencePostalCode>String</CorrespondencePostalCode>
<CorrespondenceStreet>String</CorrespondenceStreet>
<DebtorInPossession>false</DebtorInPossession>
<EMail>String</EMail>
<EstablishmentCity>String</EstablishmentCity>
<EstablishmentCountryTLA>String</EstablishmentCountryTLA>
<EstablishmentHouseNr>String</EstablishmentHouseNr>
<EstablishmentHouseNrAddition>String</EstablishmentHouseNrAddition>
<EstablishmentPostalCode>String</EstablishmentPostalCode>
<EstablishmentStreet>String</EstablishmentStreet>
<ExtraFields xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringanyType>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value />
</d2p1:KeyValueOfstringanyType>
</ExtraFields>
<Mobile>String</Mobile>
<Telephone>String</Telephone>
<Website>String</Website>
</CompanyLookupDetails>