<back to all web services

GetItemsTargetLanguagesStatuses

The following routes are available for this service:
POST/RestApi/translations/getTargetLanguagesStatuses
<?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 GetItemsTargetLanguagesStatuses implements JsonSerializable
{
    public function __construct(
        /** @var string[]|null */
        public ?array $Ids=null,
        /** @var string|null */
        public ?string $ContentType=null,
        /** @var string|null */
        public ?string $SourceLanguage=null,
        /** @var int */
        public int $Skip=0,
        /** @var int */
        public int $Take=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Ids'])) $this->Ids = JsonConverters::fromArray('string', $o['Ids']);
        if (isset($o['ContentType'])) $this->ContentType = JsonConverters::from('string', $o['ContentType']);
        if (isset($o['SourceLanguage'])) $this->SourceLanguage = $o['SourceLanguage'];
        if (isset($o['Skip'])) $this->Skip = $o['Skip'];
        if (isset($o['Take'])) $this->Take = $o['Take'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Ids)) $o['Ids'] = JsonConverters::toArray('string', $this->Ids);
        if (isset($this->ContentType)) $o['ContentType'] = JsonConverters::to('string', $this->ContentType);
        if (isset($this->SourceLanguage)) $o['SourceLanguage'] = $this->SourceLanguage;
        if (isset($this->Skip)) $o['Skip'] = $this->Skip;
        if (isset($this->Take)) $o['Take'] = $this->Take;
        return empty($o) ? new class(){} : $o;
    }
}

class ItemsTargetLanguageStatusProxy implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $SomeItemsHaveIncompatiblePendingTranslations=null,
        /** @var bool|null */
        public ?bool $AllItemsHaveIncompatiblePendingTranslations=null
    ) {
    }

    /** @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['SomeItemsHaveIncompatiblePendingTranslations'])) $this->SomeItemsHaveIncompatiblePendingTranslations = $o['SomeItemsHaveIncompatiblePendingTranslations'];
        if (isset($o['AllItemsHaveIncompatiblePendingTranslations'])) $this->AllItemsHaveIncompatiblePendingTranslations = $o['AllItemsHaveIncompatiblePendingTranslations'];
    }
    
    /** @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->SomeItemsHaveIncompatiblePendingTranslations)) $o['SomeItemsHaveIncompatiblePendingTranslations'] = $this->SomeItemsHaveIncompatiblePendingTranslations;
        if (isset($this->AllItemsHaveIncompatiblePendingTranslations)) $o['AllItemsHaveIncompatiblePendingTranslations'] = $this->AllItemsHaveIncompatiblePendingTranslations;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
/**
 * @template T
 */
class CollectionContext implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): CollectionContext {
        $to = new CollectionContext();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        // @DataMember
        /** @var int */
        public mixed $TotalCount=0,

        // @DataMember
        /** @var bool|null */
        public mixed $IsGeneric=null,

        // @DataMember
        /** @var array<string,string>|null */
        public mixed $Context=null,

        // @DataMember
        /** @var array<ItemsTargetLanguageStatusProxy>|null */
        public mixed $Items=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TotalCount'])) $this->TotalCount = $o['TotalCount'];
        if (isset($o['IsGeneric'])) $this->IsGeneric = $o['IsGeneric'];
        if (isset($o['Context'])) $this->Context = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Context']);
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('ItemsTargetLanguageStatusProxy', $o['Items']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TotalCount)) $o['TotalCount'] = $this->TotalCount;
        if (isset($this->IsGeneric)) $o['IsGeneric'] = $this->IsGeneric;
        if (isset($this->Context)) $o['Context'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Context);
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('ItemsTargetLanguageStatusProxy', $this->Items);
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetItemsTargetLanguagesStatuses DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /RestApi/translations/getTargetLanguagesStatuses HTTP/1.1 
Host: www.imglobal.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Ids":["00000000-0000-0000-0000-000000000000"],"SourceLanguage":"String","Skip":0,"Take":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"TotalCount":0,"IsGeneric":false,"Items":[]}