| GET | /RestApi/translations/projects/{id} |
|---|
<?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 XliffProxy implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $IsXliff=null,
/** @var bool|null */
public ?bool $IsFtp=null,
/** @var bool|null */
public ?bool $IsMachineTranslation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IsXliff'])) $this->IsXliff = $o['IsXliff'];
if (isset($o['IsFtp'])) $this->IsFtp = $o['IsFtp'];
if (isset($o['IsMachineTranslation'])) $this->IsMachineTranslation = $o['IsMachineTranslation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IsXliff)) $o['IsXliff'] = $this->IsXliff;
if (isset($this->IsFtp)) $o['IsFtp'] = $this->IsFtp;
if (isset($this->IsMachineTranslation)) $o['IsMachineTranslation'] = $this->IsMachineTranslation;
return empty($o) ? new class(){} : $o;
}
}
class LanguageProxy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Code=null,
/** @var string|null */
public ?string $Name=null,
/** @var int */
public int $Count=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Count'])) $this->Count = $o['Count'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Count)) $o['Count'] = $this->Count;
return empty($o) ? new class(){} : $o;
}
}
class LanguagePairProxy implements JsonSerializable
{
public function __construct(
/** @var LanguageProxy|null */
public ?LanguageProxy $ActualSource=null,
/** @var LanguageProxy|null */
public ?LanguageProxy $Target=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ActualSource'])) $this->ActualSource = JsonConverters::from('LanguageProxy', $o['ActualSource']);
if (isset($o['Target'])) $this->Target = JsonConverters::from('LanguageProxy', $o['Target']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ActualSource)) $o['ActualSource'] = JsonConverters::to('LanguageProxy', $this->ActualSource);
if (isset($this->Target)) $o['Target'] = JsonConverters::to('LanguageProxy', $this->Target);
return empty($o) ? new class(){} : $o;
}
}
class ConnectorProxy implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Title=null,
/** @var int */
public int $Count=0,
/** @var XliffProxy|null */
public ?XliffProxy $Xliff=null,
/** @var array<LanguagePairProxy>|null */
public ?array $SupportedLanguages=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Count'])) $this->Count = $o['Count'];
if (isset($o['Xliff'])) $this->Xliff = JsonConverters::from('XliffProxy', $o['Xliff']);
if (isset($o['SupportedLanguages'])) $this->SupportedLanguages = JsonConverters::fromArray('LanguagePairProxy', $o['SupportedLanguages']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Count)) $o['Count'] = $this->Count;
if (isset($this->Xliff)) $o['Xliff'] = JsonConverters::to('XliffProxy', $this->Xliff);
if (isset($this->SupportedLanguages)) $o['SupportedLanguages'] = JsonConverters::toArray('LanguagePairProxy', $this->SupportedLanguages);
return empty($o) ? new class(){} : $o;
}
}
class ProjectProxy implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $Description=null,
/** @var DateTime */
public DateTime $StartDate=new DateTime(),
/** @var DateTime */
public DateTime $DueDate=new DateTime(),
/** @var DateTime|null */
public ?DateTime $DateSent=null,
/** @var DateTime|null */
public ?DateTime $DateCompleted=null,
/** @var string|null */
public ?string $SentBy=null,
/** @var ConnectorProxy|null */
public ?ConnectorProxy $Connector=null,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $PoReference=null,
/** @var LanguageProxy|null */
public ?LanguageProxy $ActualSourceLanguage=null,
/** @var array<LanguageProxy>|null */
public ?array $TargetLanguages=null,
/** @var int */
public int $TranslationsCount=0,
/** @var bool|null */
public ?bool $CanBeCompleted=null,
/** @var string|null */
public ?string $ExternalId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['StartDate'])) $this->StartDate = JsonConverters::from('DateTime', $o['StartDate']);
if (isset($o['DueDate'])) $this->DueDate = JsonConverters::from('DateTime', $o['DueDate']);
if (isset($o['DateSent'])) $this->DateSent = JsonConverters::from('DateTime', $o['DateSent']);
if (isset($o['DateCompleted'])) $this->DateCompleted = JsonConverters::from('DateTime', $o['DateCompleted']);
if (isset($o['SentBy'])) $this->SentBy = $o['SentBy'];
if (isset($o['Connector'])) $this->Connector = JsonConverters::from('ConnectorProxy', $o['Connector']);
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['PoReference'])) $this->PoReference = $o['PoReference'];
if (isset($o['ActualSourceLanguage'])) $this->ActualSourceLanguage = JsonConverters::from('LanguageProxy', $o['ActualSourceLanguage']);
if (isset($o['TargetLanguages'])) $this->TargetLanguages = JsonConverters::fromArray('LanguageProxy', $o['TargetLanguages']);
if (isset($o['TranslationsCount'])) $this->TranslationsCount = $o['TranslationsCount'];
if (isset($o['CanBeCompleted'])) $this->CanBeCompleted = $o['CanBeCompleted'];
if (isset($o['ExternalId'])) $this->ExternalId = $o['ExternalId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->StartDate)) $o['StartDate'] = JsonConverters::to('DateTime', $this->StartDate);
if (isset($this->DueDate)) $o['DueDate'] = JsonConverters::to('DateTime', $this->DueDate);
if (isset($this->DateSent)) $o['DateSent'] = JsonConverters::to('DateTime', $this->DateSent);
if (isset($this->DateCompleted)) $o['DateCompleted'] = JsonConverters::to('DateTime', $this->DateCompleted);
if (isset($this->SentBy)) $o['SentBy'] = $this->SentBy;
if (isset($this->Connector)) $o['Connector'] = JsonConverters::to('ConnectorProxy', $this->Connector);
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->PoReference)) $o['PoReference'] = $this->PoReference;
if (isset($this->ActualSourceLanguage)) $o['ActualSourceLanguage'] = JsonConverters::to('LanguageProxy', $this->ActualSourceLanguage);
if (isset($this->TargetLanguages)) $o['TargetLanguages'] = JsonConverters::toArray('LanguageProxy', $this->TargetLanguages);
if (isset($this->TranslationsCount)) $o['TranslationsCount'] = $this->TranslationsCount;
if (isset($this->CanBeCompleted)) $o['CanBeCompleted'] = $this->CanBeCompleted;
if (isset($this->ExternalId)) $o['ExternalId'] = $this->ExternalId;
return empty($o) ? new class(){} : $o;
}
}
class GetProject implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /RestApi/translations/projects/{id} HTTP/1.1
Host: www.imglobal.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Title":"String","Description":"String","StartDate":"\/Date(-62135596800000-0000)\/","DueDate":"\/Date(-62135596800000-0000)\/","DateSent":"\/Date(-62135596800000-0000)\/","DateCompleted":"\/Date(-62135596800000-0000)\/","SentBy":"String","Connector":{"Name":"String","Title":"String","Count":0,"Xliff":{"IsXliff":false,"IsFtp":false,"IsMachineTranslation":false}},"Status":"String","PoReference":"String","ActualSourceLanguage":{"Code":"String","Name":"String","Count":0},"TargetLanguages":[{"Code":"String","Name":"String","Count":0}],"TranslationsCount":0,"CanBeCompleted":false,"ExternalId":"String"}