| PUT | /RestApi/translations/translate/mark |
|---|
<?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 MarkForTranslation implements JsonSerializable
{
public function __construct(
/** @var string[]|null */
public ?array $Ids=null,
/** @var string|null */
public ?string $ProviderName=null,
/** @var string|null */
public ?string $ItemType=null,
/** @var string|null */
public ?string $SourceLanguage=null,
/** @var string[]|null */
public ?array $TargetLanguages=null,
/** @var string|null */
public ?string $ActualSourceLanguage=null,
/** @var bool|null */
public ?bool $AllowPartialSuccess=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Ids'])) $this->Ids = JsonConverters::fromArray('string', $o['Ids']);
if (isset($o['ProviderName'])) $this->ProviderName = $o['ProviderName'];
if (isset($o['ItemType'])) $this->ItemType = $o['ItemType'];
if (isset($o['SourceLanguage'])) $this->SourceLanguage = $o['SourceLanguage'];
if (isset($o['TargetLanguages'])) $this->TargetLanguages = JsonConverters::fromArray('string', $o['TargetLanguages']);
if (isset($o['ActualSourceLanguage'])) $this->ActualSourceLanguage = $o['ActualSourceLanguage'];
if (isset($o['AllowPartialSuccess'])) $this->AllowPartialSuccess = $o['AllowPartialSuccess'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Ids)) $o['Ids'] = JsonConverters::toArray('string', $this->Ids);
if (isset($this->ProviderName)) $o['ProviderName'] = $this->ProviderName;
if (isset($this->ItemType)) $o['ItemType'] = $this->ItemType;
if (isset($this->SourceLanguage)) $o['SourceLanguage'] = $this->SourceLanguage;
if (isset($this->TargetLanguages)) $o['TargetLanguages'] = JsonConverters::toArray('string', $this->TargetLanguages);
if (isset($this->ActualSourceLanguage)) $o['ActualSourceLanguage'] = $this->ActualSourceLanguage;
if (isset($this->AllowPartialSuccess)) $o['AllowPartialSuccess'] = $this->AllowPartialSuccess;
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.
PUT /RestApi/translations/translate/mark HTTP/1.1
Host: www.imglobal.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Ids":["00000000-0000-0000-0000-000000000000"],"ProviderName":"String","ItemType":"String","SourceLanguage":"String","TargetLanguages":["String"],"ActualSourceLanguage":"String","AllowPartialSuccess":false}
HTTP/1.1 200 OK
Content-Type: application/json
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)\/"}]