| GET | /RestApi/translations/connectors |
|---|
<?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 ConnectorsProxy implements JsonSerializable
{
public function __construct(
/** @var array<ConnectorProxy>|null */
public ?array $Connectors=null,
/** @var array<string,string>|null */
public ?array $LanguagesMapping=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Connectors'])) $this->Connectors = JsonConverters::fromArray('ConnectorProxy', $o['Connectors']);
if (isset($o['LanguagesMapping'])) $this->LanguagesMapping = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['LanguagesMapping']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Connectors)) $o['Connectors'] = JsonConverters::toArray('ConnectorProxy', $this->Connectors);
if (isset($this->LanguagesMapping)) $o['LanguagesMapping'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->LanguagesMapping);
return empty($o) ? new class(){} : $o;
}
}
class GetConnectors implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
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/connectors HTTP/1.1 Host: www.imglobal.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{}