| GET | /api/global/projects/{GlobalID} |
|---|
<?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 ProjectDetails implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string */
public string $GlobalID='',
/** @var string|null */
public ?string $Number=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description1=null,
/** @var string|null */
public ?string $Description2=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var int */
public int $CorrespondenceInternalCompanyID=0,
/** @var string|null */
public ?string $CorrespondenceInternalCompanyName=null,
/** @var string */
public string $CorrespondenceInternalCompanyGlobalID='',
/** @var string|null */
public ?string $Postalcode=null,
/** @var string|null */
public ?string $City=null,
/** @var int */
public int $CountryID=0,
/** @var string */
public string $CountryGlobalID='',
/** @var string|null */
public ?string $CountryName=null,
/** @var string|null */
public ?string $GeoLocation=null,
/** @var string|null */
public ?string $AddressComplete=null,
/** @var int */
public int $CategoryID=0,
/** @var string|null */
public ?string $CategoryDescription=null,
/** @var string */
public string $CategoryGlobalID=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['GlobalID'])) $this->GlobalID = $o['GlobalID'];
if (isset($o['Number'])) $this->Number = $o['Number'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description1'])) $this->Description1 = $o['Description1'];
if (isset($o['Description2'])) $this->Description2 = $o['Description2'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['CorrespondenceInternalCompanyID'])) $this->CorrespondenceInternalCompanyID = $o['CorrespondenceInternalCompanyID'];
if (isset($o['CorrespondenceInternalCompanyName'])) $this->CorrespondenceInternalCompanyName = $o['CorrespondenceInternalCompanyName'];
if (isset($o['CorrespondenceInternalCompanyGlobalID'])) $this->CorrespondenceInternalCompanyGlobalID = $o['CorrespondenceInternalCompanyGlobalID'];
if (isset($o['Postalcode'])) $this->Postalcode = $o['Postalcode'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['CountryID'])) $this->CountryID = $o['CountryID'];
if (isset($o['CountryGlobalID'])) $this->CountryGlobalID = $o['CountryGlobalID'];
if (isset($o['CountryName'])) $this->CountryName = $o['CountryName'];
if (isset($o['GeoLocation'])) $this->GeoLocation = $o['GeoLocation'];
if (isset($o['AddressComplete'])) $this->AddressComplete = $o['AddressComplete'];
if (isset($o['CategoryID'])) $this->CategoryID = $o['CategoryID'];
if (isset($o['CategoryDescription'])) $this->CategoryDescription = $o['CategoryDescription'];
if (isset($o['CategoryGlobalID'])) $this->CategoryGlobalID = $o['CategoryGlobalID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->GlobalID)) $o['GlobalID'] = $this->GlobalID;
if (isset($this->Number)) $o['Number'] = $this->Number;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description1)) $o['Description1'] = $this->Description1;
if (isset($this->Description2)) $o['Description2'] = $this->Description2;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->CorrespondenceInternalCompanyID)) $o['CorrespondenceInternalCompanyID'] = $this->CorrespondenceInternalCompanyID;
if (isset($this->CorrespondenceInternalCompanyName)) $o['CorrespondenceInternalCompanyName'] = $this->CorrespondenceInternalCompanyName;
if (isset($this->CorrespondenceInternalCompanyGlobalID)) $o['CorrespondenceInternalCompanyGlobalID'] = $this->CorrespondenceInternalCompanyGlobalID;
if (isset($this->Postalcode)) $o['Postalcode'] = $this->Postalcode;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->CountryID)) $o['CountryID'] = $this->CountryID;
if (isset($this->CountryGlobalID)) $o['CountryGlobalID'] = $this->CountryGlobalID;
if (isset($this->CountryName)) $o['CountryName'] = $this->CountryName;
if (isset($this->GeoLocation)) $o['GeoLocation'] = $this->GeoLocation;
if (isset($this->AddressComplete)) $o['AddressComplete'] = $this->AddressComplete;
if (isset($this->CategoryID)) $o['CategoryID'] = $this->CategoryID;
if (isset($this->CategoryDescription)) $o['CategoryDescription'] = $this->CategoryDescription;
if (isset($this->CategoryGlobalID)) $o['CategoryGlobalID'] = $this->CategoryGlobalID;
return empty($o) ? new class(){} : $o;
}
}
class GetProjectDetailsByGlobalID implements JsonSerializable
{
public function __construct(
/** @var string */
public string $GlobalID=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GlobalID'])) $this->GlobalID = $o['GlobalID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GlobalID)) $o['GlobalID'] = $this->GlobalID;
return empty($o) ? new class(){} : $o;
}
}
PHP GetProjectDetailsByGlobalID 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/global/projects/{GlobalID} HTTP/1.1
Host: test-dogw.klokgroep.nl
Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ProjectDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Project"> <Active>false</Active> <AddressComplete>String</AddressComplete> <CategoryDescription>String</CategoryDescription> <CategoryGlobalID>00000000-0000-0000-0000-000000000000</CategoryGlobalID> <CategoryID>0</CategoryID> <City>String</City> <CorrespondenceInternalCompanyGlobalID>00000000-0000-0000-0000-000000000000</CorrespondenceInternalCompanyGlobalID> <CorrespondenceInternalCompanyID>0</CorrespondenceInternalCompanyID> <CorrespondenceInternalCompanyName>String</CorrespondenceInternalCompanyName> <CountryGlobalID>00000000-0000-0000-0000-000000000000</CountryGlobalID> <CountryID>0</CountryID> <CountryName>String</CountryName> <Description1>String</Description1> <Description2>String</Description2> <GeoLocation>String</GeoLocation> <GlobalID>00000000-0000-0000-0000-000000000000</GlobalID> <ID>0</ID> <Name>String</Name> <Number>String</Number> <Postalcode>String</Postalcode> </ProjectDetails>