| GET | /RestApi/translations/translations |
|---|
<?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};
enum TranslationStatus : int
{
case Marked = 101;
case Sending = 201;
case Sent = 202;
case Received = 301;
case Importing = 302;
case Imported = 303;
case Completed = 304;
case Archived = 401;
case Deleted = 402;
case Rejected = 403;
case SendingError = 501;
case ImportingError = 502;
case ReceivingError = 503;
}
class FindTranslations implements ITranslationsFilter, JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $Skip=null,
/** @var int|null */
public ?int $Take=null,
/** @var string|null */
public ?string $OrderExpression=null,
/** @var string[]|null */
public ?array $Type=null,
/** @var string|null */
public ?string $SearchText=null,
/** @var string|null */
public ?string $ActualSourceLanguage=null,
/** @var string[]|null */
public ?array $TargetLanguage=null,
/** @var string[]|null */
public ?array $Service=null,
/** @var TranslationStatus[]|null */
public ?array $TranslationStatus=null,
/** @var string[]|null */
public ?array $Status=null,
/** @var string[]|null */
public ?array $ProjectIds=null,
/** @var DateTime|null */
public ?DateTime $StartDate=null,
/** @var DateTime|null */
public ?DateTime $EndDate=null,
/** @var bool|null */
public ?bool $ErrorsOnly=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Skip'])) $this->Skip = $o['Skip'];
if (isset($o['Take'])) $this->Take = $o['Take'];
if (isset($o['OrderExpression'])) $this->OrderExpression = $o['OrderExpression'];
if (isset($o['Type'])) $this->Type = JsonConverters::fromArray('string', $o['Type']);
if (isset($o['SearchText'])) $this->SearchText = $o['SearchText'];
if (isset($o['ActualSourceLanguage'])) $this->ActualSourceLanguage = $o['ActualSourceLanguage'];
if (isset($o['TargetLanguage'])) $this->TargetLanguage = JsonConverters::fromArray('string', $o['TargetLanguage']);
if (isset($o['Service'])) $this->Service = JsonConverters::fromArray('string', $o['Service']);
if (isset($o['TranslationStatus'])) $this->TranslationStatus = JsonConverters::fromArray('TranslationStatus', $o['TranslationStatus']);
if (isset($o['Status'])) $this->Status = JsonConverters::fromArray('string', $o['Status']);
if (isset($o['ProjectIds'])) $this->ProjectIds = JsonConverters::fromArray('string', $o['ProjectIds']);
if (isset($o['StartDate'])) $this->StartDate = JsonConverters::from('DateTime', $o['StartDate']);
if (isset($o['EndDate'])) $this->EndDate = JsonConverters::from('DateTime', $o['EndDate']);
if (isset($o['ErrorsOnly'])) $this->ErrorsOnly = $o['ErrorsOnly'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Skip)) $o['Skip'] = $this->Skip;
if (isset($this->Take)) $o['Take'] = $this->Take;
if (isset($this->OrderExpression)) $o['OrderExpression'] = $this->OrderExpression;
if (isset($this->Type)) $o['Type'] = JsonConverters::toArray('string', $this->Type);
if (isset($this->SearchText)) $o['SearchText'] = $this->SearchText;
if (isset($this->ActualSourceLanguage)) $o['ActualSourceLanguage'] = $this->ActualSourceLanguage;
if (isset($this->TargetLanguage)) $o['TargetLanguage'] = JsonConverters::toArray('string', $this->TargetLanguage);
if (isset($this->Service)) $o['Service'] = JsonConverters::toArray('string', $this->Service);
if (isset($this->TranslationStatus)) $o['TranslationStatus'] = JsonConverters::toArray('TranslationStatus', $this->TranslationStatus);
if (isset($this->Status)) $o['Status'] = JsonConverters::toArray('string', $this->Status);
if (isset($this->ProjectIds)) $o['ProjectIds'] = JsonConverters::toArray('string', $this->ProjectIds);
if (isset($this->StartDate)) $o['StartDate'] = JsonConverters::to('DateTime', $this->StartDate);
if (isset($this->EndDate)) $o['EndDate'] = JsonConverters::to('DateTime', $this->EndDate);
if (isset($this->ErrorsOnly)) $o['ErrorsOnly'] = $this->ErrorsOnly;
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 /RestApi/translations/translations HTTP/1.1 Host: www.imglobal.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
[{"Title":"String","ActualSourceLanguage":{"Code":"String","Name":"String","Count":0},"TargetLanguage":{"Code":"String","Name":"String","Count":0},"ItemType":{"FullName":"String","Name":"String","Count":0},"TranslationStatus":{"Name":"String","Value":"String","Count":0,"Action":"String","SuccessfulActionMessage":"String"},"PreviewLink":"String","Status":"String","ErrorMessage":"String","ProjectId":"00000000-0000-0000-0000-000000000000","DateModified":"\/Date(-62135596800000-0000)\/"}]